Catalog Collections¶
You can interact with Catalog Collections through the API.
Basic operations¶
Listing Catalog Collections¶
data_collections = client.list_data_collections(as_type="objects")
# Returns a list of DSSDataCollection
for data_collection in data_collections:
settings = data_collection.get_settings()
# Access the main information in the Catalog Collection
print("Catalog Collection id: %s" % settings.id)
print("Display name: %s" % settings.display_name)
print("Description: %s" % settings.description)
print("Color: %s" % settings.color)
print("Tags: %s" % settings.tags)
print("Permissions: %s" % settings.permissions)
# You can also list the assets in a Catalog Collection
print("Content: %s" % data_collection.list_objects(as_type='dict'))
Modifying a Catalog Collection¶
data_collection = client.get_data_collection("someDcId")
settings = data_collection.get_settings()
settings.display_name = "new name"
settings.permissions = [*settings.permissions, DSSDataCollectionPermissionItem.reader_user("LOGIN"), DSSDataCollectionPermissionItem.contributor_group("GROUP")]
settings.save()
Creating a Catalog Collection¶
data_collection = client.create_data_collection("The name of the collection", description="Description *markdown is allowed*")
# Returns a DSSDataCollection that can be used for adding assets
Deleting a Catalog Collection¶
data_collection = client.get_data_collection("someDcId")
data_collection.delete()
Adding and removing assets from a Catalog Collection¶
Catalog Collections can contain datasets, saved models, fine-tuned models, retrieval-augmented LLMs, agents, agent tools, and semantic models.
data_collection = client.get_data_collection("someDcId")
data_collection_objects = data_collection.list_objects()
# Remove all contained assets
for data_collection_object in data_collection_objects:
data_collection_object.remove()
# Add a dataset
data_collection.add_object(client.get_project("PROJECT_KEY").get_dataset("DATASET_NAME"))
Reference documentation¶
Classes¶
A handle to interact with a Catalog Collection on the DSS instance. |
|
A handle on an object inside a Catalog Collection |
|
|
An item in a list of Catalog Collections. |
|
Helper constructors for Catalog Collection permission entries. |
|
A handle on the settings of a Catalog Collection |
Functions¶
|
Add an object to this Catalog Collection. |
|
Create a new collection and return a handle to interact with it |
|
Delete this Catalog Collection |
Gets the settings of this Catalog Collection. |
|
|
List the accessible collections |
|
List the objects in this Catalog Collection |
|
Remove this object from the Catalog Collection |
