Files, models & artifacts
Data types for files, models, artifacts, comments, revisions, and search results.
All data types support standard serialization methods (to_json, from_json, to_dict, from_dict, to_str) which are omitted from the tables below.
File
Represents a file and its associated metadata, revisions, and archive status.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| revisions | List[FileRevision] | |
| archive_status_history | List[FileArchiveStatus] | |
| resource_id | Optional[str] | |
| resource_type | Optional[str] | |
| created_by_id | Optional[str] | |
| control_tags | Optional[List[ControlTag]] | |
| updated | Optional[datetime.datetime] | |
| upstream_remote_info | Optional[UpstreamRemoteInfo] |
Methods:
| Name | Description |
|---|---|
| update_properties | Update one or more metadata properties for the latest file revision. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
| create_access | Create a new access relationship for a subject by ID. |
| create_access_by_email | Create a new access relationship for a subject by email. |
| update_access | Update an existing access relationship for a subject. |
| remove_access | Remove an existing access relationship. |
| list_access | List all access relationships for this resource. |
| archive | Archive the current item using the client’s archive method for this resource type. |
| restore | Restore the current item using the client’s restore method for this resource type. |
FileRevision
Represents a single revision of a file.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| file_id | Optional[str] | |
| content_token | Token | |
| properties_token | Token | |
| archive_status_history | List[FileRevisionArchiveStatus] | |
| name | Optional[str] | |
| stem | Optional[str] | |
| suffix | Optional[str] | |
| extension | Optional[str] | |
| description | Optional[str] | |
| size | Optional[int] | |
| mime | Optional[str] | |
| version_name | Optional[str] | |
| external_identifier | Optional[str] | |
| display_name | Optional[str] | |
| sources | Optional[List[Source]] | |
| products | Optional[List[Product]] | |
| created_by_id | Optional[str] | |
| updated | Optional[datetime.datetime] |
Methods:
| Name | Description |
|---|---|
| source_revision_ids | Return a list of revision IDs from the sources associated with this revision. |
| source_product_ids | Return a list of revision IDs from the products associated with this revision. |
| read_bytes | Read and return the raw file content for this revision. |
| from_storage_revision | Create a FileRevision from a core storage-layer revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
| archive | Archive the current item using the client’s archive method for this resource type. |
| restore | Restore the current item using the client’s restore method for this resource type. |
FileArchiveStatus
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| name | ArchiveStatusName | |
| reason | Optional[str] | |
| created_by_id | Optional[str] | |
| file_id | str |
FileCollection
A class representing a group of files, their resolvers, and their snapshot history.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| created_by_id | str | |
| resolver_set_ids | List[str] |
FileControlTagging
A control assignment to a file.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| created_by_id | str | |
| control_tag | ControlTag | |
| status | ControlTaggingStatus | |
| reason | Optional[str] | |
| inherited_from_resource_id | Optional[str] | |
| inherited_from_resource_type | Optional[str] | |
| file_id | str |
FileHaving
Mixin for objects that contain a file and expose file revision behavior.
Methods:
| Name | Description |
|---|---|
| update_properties | Update one or more metadata fields on the underlying file. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
FileRevisionArchiveStatus
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| name | ArchiveStatusName | |
| reason | Optional[str] | |
| created_by_id | Optional[str] | |
| file_revision_id | str |
FileRevisionHaving
Mixin for objects that expose a FileRevision and delegate common behaviors to it.
Methods:
| Name | Description |
|---|---|
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
Artifact
Represents an artifact with associated file, model, and metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| file | File | |
| comments | List[Comment] | |
| archive_status_history | List[ResourceArchiveStatus] | |
| created_by_id | str | |
| model_id | Optional[str] | |
| control_tags | Optional[List[ControlTag]] |
Methods:
| Name | Description |
|---|---|
| update_properties | Update one or more metadata fields on the underlying file. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
| create_access | Create a new access relationship for a subject by ID. |
| create_access_by_email | Create a new access relationship for a subject by email. |
| update_access | Update an existing access relationship for a subject. |
| remove_access | Remove an existing access relationship. |
| list_access | List all access relationships for this resource. |
| archive | Archive the current item using the client’s archive method for this resource type. |
| restore | Restore the current item using the client’s restore method for this resource type. |
Model
Represents a model resource that includes associated files, artifacts, jobs, and metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| file | File | |
| comments | List[Comment] | |
| archive_status_history | List[ResourceArchiveStatus] | |
| created_by_id | str | |
| artifacts | List[Artifact] | |
| jobs | Optional[List[Job]] | |
| control_tags | Optional[List[ControlTag]] |
Methods:
| Name | Description |
|---|---|
| add_job | Add a job associated with this model. |
| update_properties | Update one or more metadata fields on the underlying file. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
| create_access | Create a new access relationship for a subject by ID. |
| create_access_by_email | Create a new access relationship for a subject by email. |
| update_access | Update an existing access relationship for a subject. |
| remove_access | Remove an existing access relationship. |
| list_access | List all access relationships for this resource. |
| archive | Archive the current item using the client’s archive method for this resource type. |
| restore | Restore the current item using the client’s restore method for this resource type. |
ModelListItem
Model class representing a simplified summary of a Model.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| file | File | |
| archive_status | str | |
| created_by_id | str | |
| comment_ids | Optional[List[str]] | |
| artifact_ids | Optional[List[str]] | |
| job_ids | Optional[List[str]] |
Methods:
| Name | Description |
|---|---|
| update_properties | Update one or more metadata fields on the underlying file. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
Comment
Represents a comment associated with a file and a parent resource.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| file | File | |
| comments | List[Comment] | |
| archive_status_history | List[ResourceArchiveStatus] | |
| created_by_id | str | |
| resource_id | Optional[str] | |
| resource_type | Optional[str] |
Methods:
| Name | Description |
|---|---|
| update_properties | Update one or more metadata fields on the underlying file. |
| update_description | Update the file’s description. |
| update_display_name | Update the file’s display name. |
| update_external_identifier | Update the file’s external identifier. |
| update_version_name | Update the file’s version name. |
| read_bytes | Read and return the raw byte contents of the associated file revision. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
| archive | Archive the current item using the client’s archive method for this resource type. |
| restore | Restore the current item using the client’s restore method for this resource type. |
Source
Represents an upstream source that contributed to the creation of another resource.
Attributes:
| Name | Type | Description |
|---|---|---|
| revision_id | str | |
| file_id | Optional[str] | |
| resource_type | Optional[str] | |
| resource_id | Optional[str] | |
| relationship_identifier | Optional[str] |
NewSource
Represents a reference to a source revision when creating a new model or artifact. This includes the revision's unique identifier and an optional relationship identifier that describes how the source relates to the new entity (e.g., "input", "dependency").
Attributes:
| Name | Type | Description |
|---|---|---|
| revision_id | str | Unique identifier of the source revision. (required) |
| relationship_identifier | str | None | Optional label describing the relationship (e.g., "input", "dependency"). |
NewTrackedFile
Attributes:
| Name | Type | Description |
|---|---|---|
| specifier_type | TrackedFileSpecifierType | |
| file_id | Optional[str] | |
| pinned_file_revision_id | Optional[str] |
TrackedFile
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| created_by_id | str | |
| configuration_id | str | |
| specifier_type | TrackedFileSpecifierType | |
| file_id | str | |
| current_file_revision_id | str | |
| archive_status | str | |
| pinned_file_revision_id | Optional[str] |
TrackedFileSpecifierType
Attributes:
| Name | Type | Description |
|---|---|---|
| LOCKED | — | |
| LATEST | — |
FullTextSearch
Represents a search query for full-text search. Attributes ———- search_term (str): The search term. page (int): The page number for pagination. size (int): The number of items per page.
Attributes:
| Name | Type | Description |
|---|---|---|
| search_term | Annotated[str, Field(min_length=1, strict=True)] | |
| page | Optional[int] | |
| size | Optional[Annotated[int, Field(le=100, strict=True)]] |
ResourceSearchItem
Resource class for search results.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| file_id | str | |
| file_revision_id | str | |
| type_name | ResourceType | |
| created_by_id | str | |
| archive_status | ArchiveStatusName | |
| created | datetime.datetime | |
| updated | datetime.datetime | |
| name | Optional[str] | |
| extension | Optional[str] | |
| size | Optional[int] | |
| mime | Optional[str] | |
| description | Optional[str] | |
| version_name | Optional[str] | |
| external_identifier | Optional[str] | |
| display_name | Optional[str] |
SnapshotRevisionSearchItem
Attributes:
| Name | Type | Description |
|---|---|---|
| file_id | Optional[str] | |
| content_token | Token | |
| properties_token | Token | |
| name | Optional[str] | |
| extension | Optional[str] | |
| size | Optional[int] | |
| description | Optional[str] | |
| mime | Optional[str] | |
| version_name | Optional[str] | |
| external_identifier | Optional[str] | |
| display_name | Optional[str] | |
| schema_version | Optional[str] | |
| created_by_id | Optional[str] |
Methods:
| Name | Description |
|---|---|
| read_bytes | Read the byte contents associated with this snapshot. |
| read_text | Read the contents as decoded text. |
| copy_to | Copy the contents to a local file. |
| read_json | Parse the contents as JSON. |
| cleanup_cache | Clean up cached files if they exist. |
| get_cache_stats | Get filesystem cache statistics. |
ObjectStoreSha
ObjectStoreSha is a subclass of Base and represents where a file is stored.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| sha | str | |
| object_store_id | str |
ShaStorage
ShaStorage is a subclass of Base and represents where a file is stored.
Attributes:
| Name | Type | Description |
|---|---|---|
| id | str | |
| created | datetime.datetime | |
| sha | str | |
| file_store_id | str |
UploadAs
Attributes:
| Name | Type | Description |
|---|---|---|
| ARTIFACT | — | |
| MODEL | — |
PageFile
A paginated response object for listing files.
PageArtifact
A paginated response object for listing artifacts.
PageComment
A paginated response object for listing comments.
PageModelListItem
A paginated response object for listing model list items.
PageResourceSearchItem
Attributes:
| Name | Type | Description |
|---|---|---|
| items | List[ResourceSearchItem] | |
| total | Optional[int] | |
| page | Optional[int] | |
| size | Optional[int] | |
| pages | Optional[int] |
PageTrackedFile
A paginated response object for listing tracked files.
PageSnapshotRevisionSearchItem
A paginated response object for listing snapshot revision search results.
PageTypeVarCustomizedResourceSearchItem
Attributes:
| Name | Type | Description |
|---|---|---|
| items | List[ResourceSearchItem] | |
| total | Optional[int] | |
| page | Optional[int] | |
| size | Optional[int] | |
| pages | Optional[int] |