Skip to main content

Collection Objects

Represents collections in Curate. Collections are a logical grouping of data items that can be used to create datasets and perform various data curation flows.

uuid

Get the collection unique identifier (UUID). Returns:
  • UUID - The collection UUID.

name

Get the collection name. Returns:
  • str - The collection name.

description

Get the collection description. Returns:
  • Optional[str] - The collection description, or None if not available.

created_at

Get the collection creation timestamp. Returns:
  • Optional[datetime] - The timestamp when the collection was created, or None if not available.

last_edited_at

Get the collection last edit timestamp. Returns:
  • Optional[datetime] - The timestamp when the collection was last edited, or None if not available.

top_level_folder_uuid

Get the uuid of the top level folder that the collection is on. Returns:
  • UUID - the uuid of the top level folder that the collection is on

update_collection

Update the collection’s name and/or description. Arguments:
  • name Optional[str] - The new name for the collection.
  • description Optional[str] - The new description for the collection.

list_items

List storage items in the collection. Arguments:
  • include_client_metadata Optional[bool] - Whether to include client metadata for each item.
  • page_size Optional[int] - The number of items to fetch per page.
Returns:
  • Iterator[StorageItem] - An iterator containing storage items in the collection.

list_items_include_inaccessible

List storage items in the collection, including those that are inaccessible. Arguments:
  • include_client_metadata Optional[bool] - Whether to include client metadata for each item.
  • page_size Optional[int] - The number of items to fetch per page.
Returns: Iterator[Union[StorageItem, StorageItemInaccessible]]: An iterator containing both accessible and inaccessible storage items in the collection.

add_items

Add storage items to the collection. Arguments:
  • storage_item_uuids Sequence[Union[UUID, str]] - The list of storage item UUIDs to be added. Either UUIDs or string representations of UUIDs are accepted.
Returns:
  • CollectionBulkItemResponse - The response after adding items to the collection.

remove_items

Remove storage items from the collection. Arguments:
  • storage_item_uuids Sequence[Union[UUID, str]] - The list of storage item UUIDs to be removed. Either UUIDs or string representations of UUIDs are accepted.
Returns:
  • CollectionBulkItemResponse - The response after removing items from the collection.

add_items_by_title

Add storage items to the collection by Data Title. Unlike add_items(), the caller does not need to resolve titles to storage item UUIDs: resolution happens server-side. A Data Title is not unique, so a title that matches more than one storage item is not resolved to a guess: nothing is added for it and it comes back in ambiguous_titles for the caller to deal with. Each request is synchronous and returns counts describing what happened, so a large set can be verified rather than assumed. Titles are sent in successive batches, each bounded both by count and by the total size of its titles, and the counts are summed, so the returned totals describe the whole set however it was split. Long titles therefore mean more, smaller requests rather than a failed one. Duplicate titles in the input are sent once. Notes: Ambiguity is judged per request. A title is resolved against the whole folder, not against the batch, so splitting an input across batches does not change which titles are ambiguous. Arguments:
  • data_titles Iterable[str] - Data Titles to add. Any length; batched internally.
Returns:
  • CollectionDataTitleResponse - Summed counts of what matched, what was added, which titles were ambiguous, and which matched nothing.
Raises:
  • TypeError - If a single string or bytes is passed instead of a collection of titles. Both are iterable, so they would otherwise be silently taken apart into characters and sent as titles.
  • ValueError - If any single title is too long to fit in a request on its own. Raised before anything is sent, so no part of the input is added.

add_preset_items

Async operation to add storage items matching a filter preset to the collection. Arguments:
  • filter_preset Union[FilterPreset, UUID, str] - The filter preset or its UUID/ID used to filter items.

remove_preset_items

Async operation to remove storage items matching a filter preset from the collection. Arguments:
  • filter_preset Union[FilterPreset, UUID, str] - The filter preset or its UUID/ID used to filter items.

ProjectCollection Objects

Represents Project Collections inside a Project. Project Collections are a logical grouping of frames (images or video frames) or annotations (objects and classifications) that can be used to perform various data curation flows.

uuid

Get the collection unique identifier (UUID). Returns:
  • UUID - The collection UUID.

name

Get the collection name. Returns:
  • str - The collection name.

description

Get the collection description. Returns:
  • Optional[str] - The collection description, or None if not available.

created_at

Get the collection creation timestamp. Returns:
  • Optional[datetime] - The timestamp when the collection was created, or None if not available.

last_edited_at

Get the collection last edit timestamp. Returns:
  • Optional[datetime] - The timestamp when the collection was last edited, or None if not available.

collection_type

Get the type of the collection. Returns:
  • ProjectCollectionType - The type of the collection.

project_hash

Get the project hash of the collection. Returns:
  • UUID - The project hash of the collection.

update_collection

Update the collection’s name and/or description. Arguments:
  • name Optional[str] - The new name for the collection.
  • description Optional[str] - The new description for the collection.

list_frames

List frames in the collection. Arguments:
  • page_size Optional[int] - The number of items to fetch per page.
Returns: Iterator[Tuple[LabelRowV2, List[ProjectDataCollectionInstance]]]: An list of tuples containing label row and corresponding frame instances in the collection.

list_annotations

List annotations in the collection. Arguments:
  • page_size Optional[int] - The number of items to fetch per page.
Returns: Iterator[Tuple[LabelRowV2, List[ProjectLabelCollectionInstance]]]: An list of tuples containing label row and corresponding label instances in the collection.

add_items

Add data items to the collection. Arguments:
  • items Sequence[ProjectDataCollectionItemRequest | ProjectLabelCollectionItemRequest] - The list of data items to be added.
Returns:
  • ProjectCollectionBulkItemResponse - The response after adding items to the collection.

remove_items

Remove data items from the collection. Arguments:
  • items Sequence[ProjectDataCollectionItemRequest | ProjectLabelCollectionItemRequest] - The list of data items to be removed.
Returns:
  • ProjectCollectionBulkItemResponse - The response after removing items from the collection.

add_preset_items

Async operation to add storage items matching a filter preset to the collection. Arguments:
  • filter_preset Union[FilterPreset, UUID, str] - The filter preset or its UUID/ID used to filter items.

remove_preset_items

Async operation to remove storage items matching a filter preset from the collection. Arguments:
  • filter_preset Union[FilterPreset, UUID, str] - The filter preset or its UUID/ID used to filter items.