Skip to content

Metadata

Accessed via client.metadata.

pycomad.client.MetadataClient

MetadataClient(http: _HttpSession)

Methods for the asset metadata (EXIF/IPTC/XMP) sub-resource.

get

get(asset_id: Union[UUID, str]) -> AssetMetadata

Return extracted EXIF, IPTC, and XMP metadata for an asset.

Metadata is extracted automatically on upload; call :meth:refresh to re-extract after replacing the file.

Parameters:

Name Type Description Default
asset_id Union[UUID, str]

UUID of the asset.

required

Returns:

Type Description
AssetMetadata

class:~pycomad.models.AssetMetadata.

Raises:

Type Description
ComadNotFoundError

If the asset or its metadata does not exist.

ComadAuthError

If not authenticated.

refresh

refresh(asset_id: Union[UUID, str]) -> AssetMetadata

Re-extract metadata from the asset's file.

File values override any manually set fields in the assets table.

Parameters:

Name Type Description Default
asset_id Union[UUID, str]

UUID of the asset.

required

Returns:

Type Description
AssetMetadata

The refreshed :class:~pycomad.models.AssetMetadata.

Raises:

Type Description
ComadNotFoundError

If the asset does not exist or has no file.

ComadAuthError

If not authenticated.