> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collection

## Collection Objects

```python theme={"dark"}
class Collection()
```

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

#### uuid

```python theme={"dark"}
@property
def uuid() -> UUID
```

Get the collection unique identifier (UUID).

**Returns**:

* `UUID` - The collection UUID.

#### name

```python theme={"dark"}
@property
def name() -> str
```

Get the collection name.

**Returns**:

* `str` - The collection name.

#### description

```python theme={"dark"}
@property
def description() -> Optional[str]
```

Get the collection description.

**Returns**:

* `Optional[str]` - The collection description, or None if not available.

#### created\_at

```python theme={"dark"}
@property
def created_at() -> Optional[datetime]
```

Get the collection creation timestamp.

**Returns**:

* `Optional[datetime]` - The timestamp when the collection was created, or None if not available.

#### last\_edited\_at

```python theme={"dark"}
@property
def last_edited_at() -> Optional[datetime]
```

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

```python theme={"dark"}
@property
def top_level_folder_uuid() -> 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

```python theme={"dark"}
def update_collection(name: Optional[str] = None,
                      description: Optional[str] = None) -> None
```

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

```python theme={"dark"}
def list_items(include_client_metadata: Optional[bool] = None,
               page_size: Optional[int] = None) -> Iterator[StorageItem]
```

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

```python theme={"dark"}
def list_items_include_inaccessible(
    include_client_metadata: Optional[bool] = None,
    page_size: Optional[int] = None
) -> Iterator[Union[StorageItem, StorageItemInaccessible]]
```

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

```python theme={"dark"}
def add_items(
    storage_item_uuids: Sequence[Union[UUID,
                                       str]]) -> CollectionBulkItemResponse
```

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

```python theme={"dark"}
def remove_items(
    storage_item_uuids: Sequence[Union[UUID,
                                       str]]) -> CollectionBulkItemResponse
```

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\_preset\_items

```python theme={"dark"}
def add_preset_items(filter_preset: Union[FilterPreset, UUID, str]) -> None
```

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

```python theme={"dark"}
def remove_preset_items(filter_preset: Union[FilterPreset, UUID, str]) -> None
```

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

```python theme={"dark"}
class ProjectCollection()
```

Represents Active collections inside a Project.
Active 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

```python theme={"dark"}
@property
def uuid() -> UUID
```

Get the collection unique identifier (UUID).

**Returns**:

* `UUID` - The collection UUID.

#### name

```python theme={"dark"}
@property
def name() -> str
```

Get the collection name.

**Returns**:

* `str` - The collection name.

#### description

```python theme={"dark"}
@property
def description() -> Optional[str]
```

Get the collection description.

**Returns**:

* `Optional[str]` - The collection description, or None if not available.

#### created\_at

```python theme={"dark"}
@property
def created_at() -> Optional[datetime]
```

Get the collection creation timestamp.

**Returns**:

* `Optional[datetime]` - The timestamp when the collection was created, or None if not available.

#### last\_edited\_at

```python theme={"dark"}
@property
def last_edited_at() -> Optional[datetime]
```

Get the collection last edit timestamp.

**Returns**:

* `Optional[datetime]` - The timestamp when the collection was last edited, or None if not available.

#### collection\_type

```python theme={"dark"}
@property
def collection_type() -> ProjectCollectionType
```

Get the type of the collection.

**Returns**:

* `ProjectCollectionType` - The type of the collection.

#### project\_hash

```python theme={"dark"}
@property
def project_hash() -> UUID
```

Get the project hash of the collection.

**Returns**:

* `UUID` - The project hash of the collection.

#### update\_collection

```python theme={"dark"}
def update_collection(name: Optional[str] = None,
                      description: Optional[str] = None) -> None
```

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

```python theme={"dark"}
def list_frames(
    page_size: Optional[int] = None
) -> Iterator[Tuple[LabelRowV2, List[ProjectDataCollectionInstance]]]
```

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

```python theme={"dark"}
def list_annotations(
    page_size: Optional[int] = None
) -> Iterator[Tuple[LabelRowV2, List[ProjectLabelCollectionInstance]]]
```

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

```python theme={"dark"}
def add_items(
    items: List[Union[ProjectDataCollectionItemRequest,
                      ProjectLabelCollectionItemRequest]]
) -> ProjectCollectionBulkItemResponse
```

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

```python theme={"dark"}
def remove_items(
    items: List[Union[ProjectDataCollectionItemRequest,
                      ProjectLabelCollectionItemRequest]]
) -> ProjectCollectionBulkItemResponse
```

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

```python theme={"dark"}
def add_preset_items(filter_preset: Union[FilterPreset, UUID, str]) -> None
```

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

```python theme={"dark"}
def remove_preset_items(filter_preset: Union[FilterPreset, UUID, str]) -> None
```

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.
