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
Prepare explicitly coercible values without changing the source payload.
| Function | _coerce |
Normalize declared array fields without consuming the discriminator tag. |
| Function | _coerce |
Prepare collection values while preserving keys and fixed tuple positions. |
| Function | _coerce |
Normalize selected mapping entries without changing their source. |
| Function | _coerce |
Preserve compatible union branches and normalize only matching structures. |
| Function | _coerce |
Normalize a selected annotation before applying any value constraints. |
| Function | _contains |
Find coercion metadata in an annotation or its nested schema graph. |
| Function | _field |
Cache the fields requiring coercion, including their encoded positions. |
| Function | coerce |
Normalize marked schema fields using copy-on-write input containers. |
def _coerce_array(payload:
list | tuple, plan: tuple[ tuple[ str, int, object], ...], *, enabled: bool) -> object:
(source)
¶
Normalize declared array fields without consuming the discriminator tag.
| Parameters | |
payload:list | tuple | Positional schema input. |
plan:tuple[tuple[str, int, object], ...] | Encoded field names, indices and target annotations. |
enabled:bool | Whether an enclosing marker enables every field. |
| Returns | |
object | Updated positional input or the original sequence. |
Prepare collection values while preserving keys and fixed tuple positions.
| Parameters | |
value:object | Input collection or incompatible value left for validation. |
annotation:object | Collection annotation declaring its item types. |
enabled:bool | Whether an enclosing marker enables every collection value. |
| Returns | |
object | Prepared collection, or the unchanged input. |
def _coerce_mapping(payload:
Mapping[ object, object], entries: Iterable[ tuple[ object, object, object]], *, enabled: bool) -> object:
(source)
¶
Normalize selected mapping entries without changing their source.
| Parameters | |
payload:Mapping[object, object] | Original mapping copied only when a value changes. |
entries:Iterable[tuple[object, object, object]] | Keys, current values and target annotations to normalize. |
enabled:bool | Whether an enclosing marker enables every selected value. |
| Returns | |
object | Updated mapping or the original input when no values change. |
Preserve compatible union branches and normalize only matching structures.
| Parameters | |
value:object | Union input to prepare. |
annotation:object | Declared union and its branch metadata. |
enabled:bool | Whether an enclosing marker enables every branch. |
| Returns | |
object | Prepared branch value or unchanged incompatible input. |
Normalize a selected annotation before applying any value constraints.
| Parameters | |
value:object | Value to normalize. |
annotation:object | Declared type, possibly annotated, nested or a union. |
enabled:bool | Whether an enclosing marker already enabled coercion. |
| Returns | |
object | Converted value or input retained for standard error reporting. |
@lru_cache( maxsize=1024)
def _field_plan(schema: type[ msgspec.Struct], *, enabled: bool) -> tuple[ tuple[ str, int, object], ...]:
(source)
¶
Cache the fields requiring coercion, including their encoded positions.
| Parameters | |
schema:type[msgspec.Struct] | Schema whose fields are prepared. |
enabled:bool | Whether an enclosing marker enables every field in this schema. |
| Returns | |
tuple[tuple[str, int, object], ...] | Encoded names, positional indices and field annotations. |
def coerce_payload(payload:
object, schema: type[ msgspec.Struct], *, enabled: bool = False) -> object:
(source)
¶
Normalize marked schema fields using copy-on-write input containers.
| Parameters | |
payload:object | Input mapping, positional data or existing schema instance. |
schema:type[msgspec.Struct] | Schema declaring the target types and coercion metadata. |
enabled:bool, optional | Whether an enclosing marker enables all descendant fields. |
| Returns | |
object | Prepared payload, or the original value when no changes are needed. |