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.
Undocumented
| Function | _async |
Bind native asynchronous rule overrides once for a validation plan. |
| Function | _build |
Build and cache a validation plan for a schema type. |
| Async Function | _collect |
Validate a nested schema while preserving non-schema union members. |
| Async Function | _collect |
Run preclassified rule callables in declaration order. |
| Function | _collect |
Validate a nested schema value using its own cached plan. |
| Async Function | _collect |
Execute a plan containing native asynchronous rules or nested schemas. |
| Function | _collect |
Inner validation loop: execute a pre-resolved plan against an instance. |
| Function | _field |
Select executable rules from a field's validated metadata. |
| Function | _type |
Check whether a type annotation contains a nested Orionis schema. |
| Function | _type |
Inspect warmed nested schemas for native asynchronous rules. |
| Function | _warm |
Eagerly populate _PLAN_CACHE for any nested Orionis schema type. |
| Constant | _ASYNC |
Undocumented |
| Constant | _EMPTY |
Undocumented |
| Constant | _PLAN |
Undocumented |
Build and cache a validation plan for a schema type.
| Parameters | |
klass:type | Schema class whose msgspec fields and __orionis_meta__ metadata are inspected. |
| Returns | |
tuple | Cached plan entries as (field_name, field_name_dot, getter, validators, is_nested) tuples. Each entry stores the field name, the precomputed dotted field prefix, an operator.attrgetter for field access, the field's bound validator callables, and whether the field contains a nested Orionis schema. |
| Raises | |
TypeError | Raised when field metadata contains an object that is neither a Rule instance nor supported validation metadata. |
tuple, field: str, value: object, instance: object, failures: list):
(source)
¶
Run preclassified rule callables in declaration order.
| Parameters | |
validators:tuple | Pairs of bound validators and their asynchronous flags. |
field:str | Fully qualified field path. |
value:object | Converted field value. |
instance:object | Schema instance or namespace of successfully converted fields. |
failures:list | Accumulator for validation failures. |
| Returns | |
None | Every rule result has been collected without parallel database access. |
Validate a nested schema value using its own cached plan.
| Parameters | |
value:object | Nested schema instance held by the parent field. |
prefix:str | Dot-terminated path prefix already qualified with the parent field. |
failures:list | Accumulator receiving every ValidationFailure found. |
| Returns | |
None | Return None after running the nested plan, if any. |
tuple, instance: object, prefix: str, failures: list):
(source)
¶
Execute a plan containing native asynchronous rules or nested schemas.
| Parameters | |
plan:tuple | Precompiled asynchronous field plan. |
instance:object | Converted schema instance. |
prefix:str | Dot-terminated prefix for nested paths. |
failures:list | Accumulator for all failures in declaration order. |
| Returns | |
None | Synchronous and asynchronous rule results have been collected. |
Inner validation loop: execute a pre-resolved plan against an instance.
This function is the true hot path. It takes the plan as a parameter so that callers who already hold it (e.g. Schema.validate) skip the cache lookup and the type() call. Every failure is accumulated so the caller can report all of them at once.
| Parameters | |
plan:tuple | Non-empty plan produced by _build_plan for this instance's type. |
instance:object | Schema instance to validate. |
prefix:str | Dot-terminated path prefix for nested field names, e.g. "address." so that child fields report "address.zip". Pass "" at the top level. |
failures:list | Accumulator receiving every ValidationFailure found. |
| Returns | |
None | Return None after running every rule in the plan. |
type, field_name: str, items: Iterable[ object]) -> tuple[ Rule, ...]:
(source)
¶
Select executable rules from a field's validated metadata.
| Parameters | |
klass:type | Schema owning the field. |
fieldstr | Name used in metadata error messages. |
items:Iterable[object] | Declared rule and documentation metadata. |
| Returns | |
tuple[Rule, ...] | Rules in their declaration order. |
| Raises | |
TypeError | If an item is neither a rule nor supported metadata. |
Eagerly populate _PLAN_CACHE for any nested Orionis schema type.
Called from _build_plan so that the first real validation call for a nested field always hits the cache instead of triggering a cold build.
| Parameters | |
tp:object | Field type annotation, potentially an Annotated type, Union or bare class. |
| Returns | |
None | Complete the documented operation without returning a value. |