Skip to content

3D scenes, conversion, processing, IIIF

Accessed via client.scenes, client.conversion, client.processing and client.iiif.

scene = client.scenes.get(model_asset_id)                 # SVX document + version
scene.document["scenes"][0]["name"] = "Hall"
client.scenes.save(model_asset_id, scene.document, if_match=scene.version)

run = client.conversion.start(model_asset_id, source_axes="z_up")   # runs in Obair
print(client.conversion.status(model_asset_id).state)

client.processing.start(video_asset_id, set_thumbnail=False)         # probe, poster, web copy
manifest = client.iiif.manifest(video_asset_id)

pycomad.client.ScenesClient

ScenesClient(http: _HttpSession)

Authored 3D scenes (Voyager SVX documents) with version history.

get

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

Return the current scene document and its version.

Raises:

Type Description
ComadNotFoundError

If the asset does not exist or no scene was saved.

save

save(asset_id: Union[UUID, str], document: Dict[str, Any], *, if_match: Optional[int] = None) -> SavedScene

Save document (SVX 1.x or 2.x, at most 5 MiB) as the next version.

Parameters:

Name Type Description Default
asset_id Union[UUID, str]

The model asset.

required
document Dict[str, Any]

The scene document.

required
if_match Optional[int]

The version you based your edit on; the server refuses (HTTP 409) if someone saved since.

None

Raises:

Type Description
ComadValidationError

If the document is not valid SVX or too large.

ComadAuthError

If you are not the owner or the asset is locked.

ComadError

On a version conflict (409).

versions

versions(asset_id: Union[UUID, str]) -> List[SceneVersion]

List the stored versions, newest first.

get_version

get_version(asset_id: Union[UUID, str], version: int) -> SceneDocument

Return an earlier version of the scene.

pycomad.client.ConversionClient

ConversionClient(http: _HttpSession)

Convert a 3D master to a web-ready GLB derivative (runs in Obair).

start

start(asset_id: Union[UUID, str], *, source_axes: Optional[str] = None) -> RunStatus

Start a conversion.

Parameters:

Name Type Description Default
asset_id Union[UUID, str]

The model asset.

required
source_axes Optional[str]

"preserve" (default) or "z_up" to rotate a Z-up source.

None

Raises:

Type Description
ComadValidationError

If the file is not convertible.

ComadError

If a conversion is already queued or running (409).

ComadServerError

If conversion is not configured (503) or Obair did not answer.

status

status(asset_id: Union[UUID, str]) -> RunStatus

Return the state of the latest conversion.

Raises:

Type Description
ComadNotFoundError

If none was ever started (or Obair has forgotten it).

pycomad.client.ProcessingClient

ProcessingClient(http: _HttpSession)

Process a video or audio recording: probe, poster/waveform and web-playable copy.

start

start(asset_id: Union[UUID, str], *, make_web_copy: Optional[bool] = None, set_thumbnail: Optional[bool] = None) -> RunStatus

Start processing.

Parameters:

Name Type Description Default
asset_id Union[UUID, str]

The video or audio asset.

required
make_web_copy Optional[bool]

Make a browser-playable copy when needed (server default True).

None
set_thumbnail Optional[bool]

Set the poster frame / waveform as the thumbnail (default True); pass False to keep a thumbnail the owner chose.

None

Raises:

Type Description
ComadValidationError

If the asset is not a recording or has no file.

ComadError

If processing is already queued or running (409).

status

status(asset_id: Union[UUID, str]) -> RunStatus

Return the state of the latest processing run.

Raises:

Type Description
ComadNotFoundError

If none was started for this asset.

pycomad.client.IiifClient

IiifClient(http: _HttpSession)

IIIF 3.0 manifests and collections. Public assets need no login; a token, if you have one, also unlocks your private assets.

manifest

manifest(asset_id: Union[UUID, str]) -> Dict[str, Any]

Return the IIIF manifest of an asset (images, or Video/Sound canvases with duration, playable copy and WebVTT captions).

collection

collection(category_id: Union[UUID, str]) -> Dict[str, Any]

Return the IIIF collection of a category's public assets.

image_info

image_info(asset_id: Union[UUID, str]) -> Dict[str, Any]

Return the IIIF Image API info.json of a raster image.

image_url

image_url(asset_id: Union[UUID, str], *, region: str = 'full', size: str = 'max', rotation: str = '0', quality: str = 'default', fmt: str = 'jpg') -> str

Build an IIIF Image API URL (fetch it with any HTTP client).