artifacts
5 minute read
module wandb.apis.public
W&B Public API for Artifact objects.
This module provides classes for interacting with W&B artifacts and their collections.
function server_supports_artifact_collections_gql_edges
server_supports_artifact_collections_gql_edges(
client: 'RetryingClient',
warn: 'bool' = False
) → bool
Check if W&B server supports GraphQL edges for artifact collections.
class ArtifactTypes
method ArtifactTypes.__init__
__init__(client: 'Client', entity: 'str', project: 'str', per_page: 'int' = 50)
property ArtifactTypes.cursor
Returns the cursor for the next page of results.
property ArtifactTypes.length
Returns None
.
property ArtifactTypes.more
Returns whether there are more artifact types to fetch.
method ArtifactTypes.convert_objects
convert_objects() → list[ArtifactType]
Convert the raw response data into a list of ArtifactType objects.
method ArtifactTypes.update_variables
update_variables() → None
Update the cursor variable for pagination.
class ArtifactType
An artifact object that satisfies query based on the specified type.
Args:
client
: The client instance to use for querying W&B.entity
: The entity (user or team) that owns the project.project
: The name of the project to query for artifact types.type_name
: The name of the artifact type.attrs
: Optional mapping of attributes to initialize the artifact type. If not provided, the object will load its attributes from W&B upon initialization.
method ArtifactType.__init__
__init__(
client: 'Client',
entity: 'str',
project: 'str',
type_name: 'str',
attrs: 'Mapping[str, Any] | None' = None
)
property ArtifactType.id
The unique identifier of the artifact type.
property ArtifactType.name
The name of the artifact type.
method ArtifactType.collection
collection(name: 'str') → ArtifactCollection
Get a specific artifact collection by name.
Args:
name
(str): The name of the artifact collection to retrieve.
method ArtifactType.collections
collections(per_page: 'int' = 50) → ArtifactCollections
Get all artifact collections associated with this artifact type.
Args:
per_page
(int): The number of artifact collections to fetch per page. Default is 50.
method ArtifactType.load
load() → Mapping[str, Any]
Load the artifact type attributes from W&B.
class ArtifactCollections
Artifact collections of a specific type in a project.
Args:
client
: The client instance to use for querying W&B.entity
: The entity (user or team) that owns the project.project
: The name of the project to query for artifact collections.type_name
: The name of the artifact type for which to fetch collections.per_page
: The number of artifact collections to fetch per page. Default is 50.
method ArtifactCollections.__init__
__init__(
client: 'Client',
entity: 'str',
project: 'str',
type_name: 'str',
per_page: 'int' = 50
)
property ArtifactCollections.cursor
Returns the cursor for the next page of results.
property ArtifactCollections.length
property ArtifactCollections.more
Returns whether there are more artifacts to fetch.
method ArtifactCollections.convert_objects
convert_objects() → list[ArtifactCollection]
Convert the raw response data into a list of ArtifactCollection objects.
method ArtifactCollections.update_variables
update_variables() → None
Update the cursor variable for pagination.
class ArtifactCollection
An artifact collection that represents a group of related artifacts.
Args:
client
: The client instance to use for querying W&B.entity
: The entity (user or team) that owns the project.project
: The name of the project to query for artifact collections.name
: The name of the artifact collection.type
: The type of the artifact collection (e.g., “dataset”, “model”).organization
: Optional organization name if applicable.attrs
: Optional mapping of attributes to initialize the artifact collection. If not provided, the object will load its attributes from W&B upon initialization.
method ArtifactCollection.__init__
__init__(
client: 'Client',
entity: 'str',
project: 'str',
name: 'str',
type: 'str',
organization: 'str | None' = None,
attrs: 'Mapping[str, Any] | None' = None,
is_sequence: 'bool | None' = None
)
property ArtifactCollection.aliases
Artifact Collection Aliases.
property ArtifactCollection.created_at
The creation date of the artifact collection.
property ArtifactCollection.description
A description of the artifact collection.
property ArtifactCollection.id
The unique identifier of the artifact collection.
property ArtifactCollection.name
The name of the artifact collection.
property ArtifactCollection.tags
The tags associated with the artifact collection.
property ArtifactCollection.type
Returns the type of the artifact collection.
method ArtifactCollection.artifacts
artifacts(per_page: 'int' = 50) → Artifacts
Get all artifacts in the collection.
method ArtifactCollection.change_type
change_type(new_type: 'str') → None
Deprecated, change type directly with save
instead.
method ArtifactCollection.delete
delete() → None
Delete the entire artifact collection.
method ArtifactCollection.is_sequence
is_sequence() → bool
Return whether the artifact collection is a sequence.
method ArtifactCollection.load
load()
Load the artifact collection attributes from W&B.
method ArtifactCollection.save
save() → None
Persist any changes made to the artifact collection.
class Artifacts
An iterable collection of artifact versions associated with a project.
Optionally pass in filters to narrow down the results based on specific criteria.
Args:
client
: The client instance to use for querying W&B.entity
: The entity (user or team) that owns the project.project
: The name of the project to query for artifacts.collection_name
: The name of the artifact collection to query.type
: The type of the artifacts to query. Common examples include “dataset” or “model”.filters
: Optional mapping of filters to apply to the query.order
: Optional string to specify the order of the results.per_page
: The number of artifact versions to fetch per page. Default is 50.tags
: Optional string or list of strings to filter artifacts by tags.
method Artifacts.__init__
__init__(
client: 'Client',
entity: 'str',
project: 'str',
collection_name: 'str',
type: 'str',
filters: 'Mapping[str, Any] | None' = None,
order: 'str | None' = None,
per_page: 'int' = 50,
tags: 'str | list[str] | None' = None
)
property Artifacts.cursor
Returns the cursor for the next page of results.
property Artifacts.length
Returns the total number of artifacts in the collection.
property Artifacts.more
Returns whether there are more files to fetch.
method Artifacts.convert_objects
convert_objects() → list[Artifact]
Convert the raw response data into a list of wandb.Artifact objects.
class RunArtifacts
method RunArtifacts.__init__
__init__(
client: 'Client',
run: 'Run',
mode: "Literal['logged', 'used']" = 'logged',
per_page: 'int' = 50
)
property RunArtifacts.cursor
Returns the cursor for the next page of results.
property RunArtifacts.length
Returns the total number of artifacts in the collection.
property RunArtifacts.more
Returns whether there are more artifacts to fetch.
method RunArtifacts.convert_objects
convert_objects() → list[Artifact]
Convert the raw response data into a list of wandb.Artifact objects.
class ArtifactFiles
method ArtifactFiles.__init__
__init__(
client: 'Client',
artifact: 'Artifact',
names: 'Sequence[str] | None' = None,
per_page: 'int' = 50
)
property ArtifactFiles.cursor
Returns the cursor for the next page of results.
property ArtifactFiles.length
Returns the total number of files in the artifact.
property ArtifactFiles.more
Returns whether there are more files to fetch.
property ArtifactFiles.path
Returns the path of the artifact.
method ArtifactFiles.convert_objects
convert_objects() → list[public.File]
Convert the raw response data into a list of public.File objects.
method ArtifactFiles.update_variables
update_variables() → None
Update the variables dictionary with the cursor.
Feedback
Was this page helpful?
Glad to hear it! If you have more to say, please let us know.
Sorry to hear that. Please tell us how we can improve.