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.

module documentation

Compile schema declarations and provide their structured representation.

Class SchemaMeta Collect schema declarations and prepare their validation metadata.
Function _compile_annotated Compile an Annotated layer and preserve its local error messages.
Function _compile_annotation Compile constraints throughout an annotation and its nested types.
Constant _CONSTRAINT_MSGSPEC_KEYS ValidationMetadata subclass -> msgspec.Meta keyword argument name.
Variable _StructMeta The metaclass for all Schema subclasses. Intercept class creation to compile ValidationMetadata into msgspec.Meta and collect custom metadata for later use.
def _compile_annotated(annotation: object, arguments: tuple, *, nested: bool) -> tuple[object, dict[str, str]]: (source)

Compile an Annotated layer and preserve its local error messages.

Parameters
annotation:objectOriginal Annotated declaration.
arguments:tupleBase type followed by the declaration's metadata items.
nested:boolWhether the declaration belongs to a collection item or union branch.
Returns
tuple[object, dict[str, str]]Rebuilt annotation and its messages indexed by validation code.
Raises
TypeErrorIf nested metadata contains a rule requiring field-level execution.
orionis.schemas.compiler.MetadataConflictErrorIf constraint declarations are invalid or incompatible.
def _compile_annotation(annotation: object, *, nested: bool = False) -> tuple[object, dict[str, str]]: (source)

Compile constraints throughout an annotation and its nested types.

Parameters
annotation:objectField or element annotation to compile.
nested:bool, optionalWhether the annotation belongs to a collection item or union branch.
Returns
tuple[object, dict[str, str]]Compiled annotation and messages declared on its outer metadata layer.
Raises
TypeErrorIf a collection item or union branch declares an unsupported rule.
orionis.schemas.compiler.MetadataConflictErrorIf constraint declarations are invalid or incompatible.
_CONSTRAINT_MSGSPEC_KEYS: dict[type, str] = (source)

ValidationMetadata subclass -> msgspec.Meta keyword argument name.

Value
{MinLength: 'min_length',
 MaxLength: 'max_length',
 Pattern: 'pattern',
 GreaterThan: 'gt',
 GreaterThanOrEqual: 'ge',
 LessThan: 'lt',
 LessThanOrEqual: 'le',
...
_StructMeta = (source)

The metaclass for all Schema subclasses. Intercept class creation to compile ValidationMetadata into msgspec.Meta and collect custom metadata for later use.