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, agents, agent tools, agent skills, semantic models, knowledge banks, and managed folders.

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 assets from the project
project = client.get_project("PROJECT_KEY")
data_collection.add_object(project.get_dataset("DATASET_NAME"))
data_collection.add_object(project.get_saved_model("SAVED_MODEL_ID"))
data_collection.add_object(project.get_saved_model("FINE_TUNED_MODEL_ID"))
data_collection.add_object(project.get_agent("AGENT_ID"))
data_collection.add_object(project.get_agent_tool("AGENT_TOOL_ID"))
data_collection.add_object(project.get_semantic_model("SEMANTIC_MODEL_ID"))
data_collection.add_object(project.get_knowledge_bank("KNOWLEDGE_BANK_ID"))
data_collection.add_object(project.get_agent_skill("AGENT_SKILL_ID"))
data_collection.add_object(project.get_managed_folder("MANAGED_FOLDER_ID"))

Reference documentation

Classes

dataikuapi.dss.data_collection.DSSDataCollection(...)

A handle to interact with a Catalog Collection on the DSS instance.

dataikuapi.dss.data_collection.DSSDataCollectionItem(...)

A handle on an object inside a Catalog Collection

dataikuapi.dss.data_collection.DSSDataCollectionListItem(...)

An item in a list of Catalog Collections.

dataikuapi.dss.data_collection.DSSDataCollectionPermissionItem()

Helper constructors for Catalog Collection permission entries.

dataikuapi.dss.data_collection.DSSDataCollectionSettings(...)

A handle on the settings of a Catalog Collection

Functions

add_object(obj)

Add an object to this Catalog Collection.

create_data_collection(displayName[, id, ...])

Create a new collection and return a handle to interact with it

delete()

Delete this Catalog Collection

get_settings()

Gets the settings of this Catalog Collection.

list_data_collections([as_type])

List the accessible collections

list_objects([as_type, filter_type])

List the objects in this Catalog Collection

remove()

Remove this object from the Catalog Collection