Skip to content

Profiles

Python-friendly profile declaration.

Profile

Observation profile with a declarative assembly and feature metadata.

The assembly may be declared in a list or grouped in a mapping; mapping groups are flattened in insertion order. Subclasses replace inherited assemblies unless they explicitly include the base assembly. A ProfileFeatures instance may group feature declarations referenced by assembly outputs. Relations declare resolutions linking to other profiles without changing the observation grain.

Parameters:

Name Type Description Default
id str | None

Globally unique profile identifier.

None
assembly Sequence[Operator] | Mapping[str, Sequence[Operator]] | None

Operators as a sequence or as named groups of operators.

None
name str | None

Human-readable profile name.

None
description str | None

Description of the profile.

None
category str | None

Free-form grouping label.

None
scope str | None

Free-form description of the observation scope.

None
seed str | None

ID of the assembly operator that initializes the dataset. The operator must have an explicit ID, return a complete dataframe containing the profile's grain keys, and use a compute binding without a merge. It cannot consume the target dataset. A source dataframe from another profile must be non-nullable. Other fragments merge after the seed. When omitted, accumulation follows the existing behavior.

None
grain Sequence[Resolution] | None

Resolutions identifying profile rows.

None
relations Sequence[Resolution] | None

Resolutions relating the profile to other profiles.

None
order Sequence[Order] | None

Logical ordering of profile observations.

None

id instance-attribute

id: str

name class-attribute instance-attribute

name: str | None = None

description class-attribute instance-attribute

description: str | None = None

category class-attribute instance-attribute

category: str | None = None

scope class-attribute instance-attribute

scope: str | None = None

features class-attribute instance-attribute

features: FeatureSet | None = None

grain class-attribute instance-attribute

grain: Sequence[Resolution] = ()

relations class-attribute instance-attribute

relations: Sequence[Resolution] = ()

order class-attribute instance-attribute

order: Sequence[Order] = ()

seed class-attribute instance-attribute

seed: str | None = None

dataset property

dataset: Reference

Reference this profile's dataset without materializing it.

identifiers property

identifiers: list[str]

Return only the selected grain columns identifying profile rows.

identifier_types property

identifier_types: dict[str, str]

Return logical types for the selected grain identifiers.

relation_types property

relation_types: dict[str, str]

Return logical types for declared relation columns.

keys property

keys: list[str]

Return identifiers and relations in declaration order.

key_types property

key_types: dict[str, str]

Return logical types for identifiers and relations together.

assembly class-attribute instance-attribute

assembly: Sequence[Operator] | Mapping[str, Sequence[Operator]] = self._flatten_assembly(self.assembly if assembly is None else assembly)

to_model

to_model() -> spec_model.Profile

Build the canonical profile, rejecting duplicate feature producers.

function_catalog

function_catalog() -> spec_model.FunctionCatalog

Collect reusable function contracts without executing implementations.

ProfileRegistry

Register profile classes and instantiate their declarations without execution.

profiles instance-attribute

profiles: dict[str, Profile] = {}

to_declarations

to_declarations() -> dict[str, Profile]

Return registered profile declarations in composition order.