Skip to content

Spec

Python-friendly spec declarations.

Spec dataclass

Build a spec by inferring dimensions from profile grain declarations.

Parameters:

Name Type Description Default
profiles Sequence[type[Profile] | Profile]

Profile classes or declarations with globally unique IDs.

required
name str | None

Optional spec display name.

None

name class-attribute instance-attribute

name: str | None = None

profiles cached property

profiles: tuple[Profile, ...]

Instantiate profile classes and reject duplicate global IDs.

function_catalog

function_catalog() -> spec_model.FunctionCatalog

Collect and merge the function catalog across all profiles.

to_model

to_model() -> spec_model.Spec

Return the spec document model without resolving entrypoints.

to_dict

to_dict() -> dict[str, typing.Any]

Return the spec document as a dictionary.