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

Provide schemas operations.

Includes register_messages, annotation_messages, constraint_plan.

Class _ConstraintMessages Keep annotations with distinct messages from sharing a typing cache key.
Function _constraint_probes Build independent checks for the constraints in one metadata entry.
Function annotation_messages Retrieve local messages by annotation identity.
Function constraint_plan Build and cache independent native checks for local constraints.
Function register_messages Attach and index local messages during annotation compilation.
Constant _CACHE Cache definitions used by constraint_plan.
Constant _KEYS Keys definitions used by constraint_plan.
Constant _MESSAGES Messages definitions used by constraint_plan.
def _constraint_probes(probe_base: object, meta: msgspec.Meta, messages: dict[str, str]) -> list[tuple[str, object, str | None]]: (source)

Build independent checks for the constraints in one metadata entry.

Parameters
probe_base:objectUnconstrained type checked by each probe.
meta:msgspec.MetaNative constraint metadata to split into individual checks.
messages:dict[str, str]Custom messages indexed by validation code.
Returns
list[tuple[str, object, str | None]]Entries of (code, annotation, custom_message).
def annotation_messages(annotation: object) -> dict[str, str]: (source)

Retrieve local messages by annotation identity.

Parameters
annotation:objectAnnotation whose custom messages are requested.
Returns
dict[str, str]Registered messages, or an empty mapping when none exist.
def constraint_plan(annotation: object) -> tuple[object, tuple]: (source)

Build and cache independent native checks for local constraints.

Parameters
annotation:objectField or element annotation, optionally containing union branches.
Returns
tuple[object, tuple]Type without local constraints and checks of (code, annotation, custom_message) for each constraint.
def register_messages(annotation: object, messages: dict[str, str]) -> object: (source)

Attach and index local messages during annotation compilation.

Parameters
annotation:objectCompiled annotation that owns the messages.
messages:dict[str, str]Custom messages indexed by validation code.
Returns
objectAnnotation carrying distinct message metadata, or the original annotation when no messages are supplied.

Cache definitions used by constraint_plan.

Value
{}
_KEYS: tuple[str, ...] = (source)

Keys definitions used by constraint_plan.

Value
('gt',
 'ge',
 'lt',
 'le',
 'multiple_of',
 'pattern',
 'min_length',
...

Messages definitions used by constraint_plan.

Value
{}