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 the indexed metadata for all semantic conflicts in a single pass.
Static Method compile Compile metadata annotations into a field constraint descriptor.
Class Variable __slots__ Undocumented

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[ValidationMetadata]Raw annotation list from the caller.
Returns
dict[type[ValidationMetadata], ValidationMetadata]Mapping from each concrete metadata type to its single instance.
Raises
MetadataConflictErrorIf the same concrete type appears more than once.

Validate the indexed metadata for all semantic conflicts in a single pass.

Checks are applied in order: ambiguous bounds, impossible numeric ranges, impossible length ranges, mutually exclusive timezone flags, and invalid individual values. All checks are inlined to eliminate five separate staticmethod call overheads and to consolidate shared seen.get() calls (MinLength and MaxLength are looked up once instead of twice).

Parameters
seen:dict[type[ValidationMetadata], ValidationMetadata]The indexed metadata mapping produced by _index.
Returns
NoneComplete the documented operation without returning a value.
Raises
MetadataConflictErrorOn any detected conflict.
def compile(metadata: list[ValidationMetadata]) -> msgspec.Meta: (source)

Compile metadata annotations into a field constraint descriptor.

Parameters
metadata:list[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
MetadataConflictErrorIf any duplicate or logically conflicting metadata is detected before the descriptor is constructed.
__slots__: tuple = (source)

Undocumented