ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class MetaCompiler: (source)

View In Hierarchy

Compile Orionis metadata annotations into a field constraint descriptor.

Act as the single integration point between Orionis' public metadata API and the underlying serialization layer. Schema consumers (validation, JSON Schema generation, OpenAPI export) should use this compiler so that the serialization layer remains an implementation detail invisible to application code.

Static Method _build Construct the field constraint descriptor from the validated metadata index.
Static Method _index Build a type → instance mapping and reject duplicate types.
Static Method _validateConflicts Validate numeric bounds, length ranges and individual metadata values.
Static Method _validateLengthRange Reject a minimum length greater than the declared maximum.
Static Method _validateNumericBounds Reject ambiguous or impossible combinations of numeric bounds.
Static Method _validateValues Reject conflicting timezones, nonpositive divisors and negative lengths.
Static Method compile Compile metadata annotations into a field constraint descriptor.
Class Variable __slots__ Declare that this class introduces no additional instance slots.

Construct the field constraint descriptor from the validated metadata index.

Built in a single pass over seen to avoid allocating intermediate dictionaries. All fourteen msgspec.Meta parameters are populated here in one go, each guarded by an O(1) dict look-up.

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]The conflict-free metadata index produced by _index.
Returns
msgspec.MetaThe fully configured field constraint descriptor.

Build a type → instance mapping and reject duplicate types.

Parameters
metadata:list[orionis.schemas.meta.validation.ValidationMetadata]Raw annotation list from the caller.
Returns
dict[type[ValidationMetadata], ValidationMetadata]Mapping from each concrete metadata type to its single instance.
Raises
orionis.schemas.compiler.MetadataConflictErrorIf the same concrete type appears more than once.

Validate numeric bounds, length ranges and individual metadata values.

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]The indexed metadata mapping produced by _index.
Returns
NoneNo return value.
Raises
orionis.schemas.compiler.MetadataConflictErrorOn any detected conflict.

Reject a minimum length greater than the declared maximum.

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]Indexed declarations to compare.
Returns
NoneNo return value.
Raises
MetadataConflictErrorIf no length can satisfy both bounds.

Reject ambiguous or impossible combinations of numeric bounds.

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]Indexed declarations with at most one of each concrete metadata type.
Returns
NoneNo return value.
Raises
MetadataConflictErrorIf numeric bounds overlap ambiguously or permit no valid values.

Reject conflicting timezones, nonpositive divisors and negative lengths.

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]Indexed declarations whose individual values must be valid.
Returns
NoneNo return value.
Raises
MetadataConflictErrorIf timezone requirements conflict or an individual value is invalid.
def compile(metadata: list[ValidationMetadata]) -> msgspec.Meta: (source)

Compile metadata annotations into a field constraint descriptor.

Parameters
metadata:list[orionis.schemas.meta.validation.ValidationMetadata]The list of field-level metadata annotations to compile. Order does not matter; each concrete type may appear at most once.
Returns
msgspec.MetaA field constraint descriptor configured with all provided constraints and documentation properties.
Raises
orionis.schemas.compiler.MetadataConflictErrorIf any duplicate or logically conflicting metadata is detected before the descriptor is constructed.
__slots__: tuple = (source)

Declare that this class introduces no additional instance slots.