betty.assets module

The Assets API.

class betty.assets.AssetRepository[source]

Bases: object

Manages a set of assets.

This repository unifies several directory paths on disk, overlaying them on each other. Paths added later act as fallbacks, e.g. earlier paths have priority.

Parameters:

assets_directory_paths (pathlib.Path)

__init__(*assets_directory_paths: pathlib.Path)[source]
Parameters:

assets_directory_paths (pathlib.Path)

property assets_directory_paths: Sequence[Path]

The paths to the individual virtual layers.

walk(asset_directory_path: pathlib.Path | None = None) collections.abc.Iterator[pathlib.Path][source]

Get virtual paths to available assets.

Parameters:

asset_directory_path (pathlib.Path | None) – If given, only asses under the directory are returned.

Return type:

collections.abc.Iterator[pathlib.Path]