StorageItem

StorageItem

Here's an SDK reference entry for the StorageItem class:

class encord.storage.StorageItem(api_client, orm_item)

Initializes a StorageItem instance.

Parameters:

  • api_client (ApiClient): The API client used to interact with the backend.
  • orm_item (orm_storage.StorageItem): The ORM model of the Storage item.

property uuid: UUID

Gets the unique identifier (UUID) of the Storage item.

Return Type:

UUID


property parent_folder_uuid: UUID

Gets the UUID of the parent folder.

Return Type:

UUID


property item_type: StorageItemType

Gets the type of the Storage item.

Return Type:

StorageItemType


property name: str

Gets the name of the Storage item.

Return Type:

str

property description: str

Gets the description of the Storage item.

Return Type:

str


property client_metadata: Optional[Dict[str, Any]]

Gets the parsed custom metadata if available.

Return Type:

Optional[Dict[str, Any]]


property created_at: datetime

Gets the creation date and time of the item.

Return Type:

datetime


property last_edited_at: datetime

Gets the last edited date and time of the item.

Return Type:

datetime


property backed_data_units_count: int

Gets the count of data units backed by this item.

Return Type:

int


property storage_location: StorageLocationName

Gets the Storage location of the item.

Return Type:

StorageLocationName


property integration_hash: Optional[UUID]

Gets the integration hash associated with the item, if any.

Return Type:

Optional[UUID]


property url: Optional[str]

Gets the URL of the item, if available.

Return Type:

Optional[str]


property file_size: Optional[int]

Gets the file size in bytes.

Return Type:

Optional[int]


property mime_type: Optional[str]

Gets the MIME type of the item.

Return Type:

Optional[str]


property duration: Optional[float]

Gets the duration of the item in seconds, if applicable (for videos).

Return Type:

Optional[float]


property fps: Optional[float]

Gets the frames per second, if applicable (for videos).

Return Type:

Optional[float]


property height: Optional[int]

Gets the height of the item in pixels, if applicable.

Return Type:

Optional[int]


property width: Optional[int]

Gets the width of the item in pixels, if applicable.

Return Type:

Optional[int]


property dicom_instance_uid: Optional[str]

Gets the DICOM instance UID, if applicable.

Return Type:

Optional[str]


property dicom_study_uid: Optional[str]

Gets the DICOM study UID, if applicable.

Return Type:

Optional[str]


property dicom_series_uid: Optional[str]

Gets the DICOM series UID, if applicable.

Return Type:

Optional[str]


property frame_count: Optional[int]

Gets the number of frames, if applicable (for image sequences or videos).

Return Type:

Optional[int]


parent_folder

parent_folder()

Retrieves the parent folder as a StorageFolder object.

Returns:

The parent folder of the item.

Return type:

StorageFolder


get_signed_url

Gets a signed URL for downloading the item, with an option to refetch the URL if it is not present or must be updated.

Parameters:

  • refetch (bool, optional): If True, the URL is refetched. Defaults to False.

Returns:

Returns a signed URL for the item or None if the item type does not support it.

Return type:

Optional[str]


get_summary

Gets a summary of the Storage item, which includes linked Datasets and other relevant information.

Returns:

A summary of the Storage item, including details such as linked Datasets.

Return type:

StorageItemSummary


get_child_items

Retrieves child items of a storage item, applicable for items like image groups or DICOM series.

Parameters:

  • get_signed_urls (bool, optional): Specifies whether to fetch signed URLs for the child items. Defaults to False.

Returns:

An iterable of StorageItem objects representing the child items. The list is empty if the item has no children.

Return type:

IterableStorageItem


update

Updates modifiable properties of the Storage item.

Parameters:

  • name (Optional[str], optional): The new name of the item.
  • description (Optional[str], optional): The new description of the item.
  • client_metadata (Optional[Dict[str, Any]], optional): New metadata to associate with the item.

Returns:

This method does not return a result.

Return type:

None


delete

Deletes the storage item from Encord storage.

Parameters:

  • remove_unused_frames (bool, optional): Specifies whether to also remove unused frames associated with the item. Defaults to True.

Returns:

This method does not return a result.

Return type:

None


move_to_folder

Moves the Storage item to another folder.

Parameters:

  • target_folder (Union[StorageFolder, UUID]): The target folder or its UUID to which the item should be moved.

Returns:

This method does not return a result.

Return type:

None


refetch_data

Refetches the data for the storage item, optionally fetching a signed URL.

Parameters:

  • get_signed_url (bool, optional): Specifies whether to fetch a signed URL for the item. Defaults to False.

Returns:

This method updates the item's data but does not return a result.

Return type:

None