src.models.common module#

Common Pydantic models and functions.

class src.models.common.Artifact(*, artifactType: str, name: str, url: str, timestamp: Optional[str] = None, framework: Optional[str] = None)[source]#

Bases: BaseModel

Artifact model for model cards. Artifacts can be linked models, datasets, or other artifacts.

class Config[source]#

Bases: object

Pydantic config to allow creation of data model from a JSON object with camelCase keys.

allow_population_by_field_name = True#
_abc_impl = <_abc._abc_data object>#
artifact_type: str#
framework: Optional[str]#
name: str#
timestamp: Optional[str]#
url: str#
class src.models.common.PyObjectId(oid: Optional[Union[str, ObjectId, bytes]] = None)[source]#

Bases: ObjectId

Custom Pydantic type for MongoDB ObjectIds.

__id#
classmethod validate(v: str) ObjectId[source]#

Validate the objectid.

Parameters:

v (str) – Objectid to validate

Raises:

ValueError – If objectid is invalid

Returns:

Validated objectid

Return type:

ObjectId

class src.models.common.S3Storage(*, bucket_name: str, object_name: str)[source]#

Bases: BaseModel

Custom Pydantic type for storing S3 bucket and object information as a dict

_abc_impl = <_abc._abc_data object>#
bucket_name: str#
object_name: str#