Skip to content

Definitions and catalogue

Language-neutral definition files, the registry of shipped ones, and the definitions this package ships.

write_scale

write_scale(
    x: NestedScale,
    path: str | PathLike,
    format: str = "json",
    tables: str = "auto",
    overwrite: bool = False,
) -> Path

Write a scale as a definition: one file (.json/.yaml) with inline tables, or a bundle directory with scale.json and table files.

read_scale

read_scale(
    path: str | PathLike,
    package: str | None = None,
    cls: str = "stored",
) -> NestedScale

Read a definition file, a bundle directory or a catalogue id.

scale_catalog

scale_catalog() -> list[dict]

Every definition the registered directories hold (headers only).

register_scale_dir

register_scale_dir(
    path: str | PathLike, package: str | None = None
) -> str

list_scale_dirs

list_scale_dirs() -> list[dict]

clear_scale_dirs

clear_scale_dirs() -> None