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.
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 | _expand |
Expand existing struct items and leave native input representations intact. |
| Function | _field |
Cache fields requiring coercion or struct expansion and their wire positions. |
| Function | _plain |
Select uniform struct items whose fields need no further preparation. |
| Function | _requires |
Find coercion markers or struct types requiring instance revalidation. |
| Function | coerce |
Prepare marked values and existing structs using copy-on-write containers. |
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. |
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. |
list | tuple | set | frozenset, schema: type[ msgspec.Struct]) -> object:
(source)
¶
Expand existing struct items and leave native input representations intact.
| Parameters | |
value:list | tuple | set | frozenset | Homogeneous collection copied only when an instance needs expansion. |
schema:type[msgspec.Struct] | Item type with no descendant coercion or struct preparation. |
| Returns | |
object | Original collection or a copy containing expanded instance payloads. |
type[ msgspec.Struct], *, enabled: bool) -> tuple[ tuple[ str, int, object], ...]:
(source)
¶
Cache fields requiring coercion or struct expansion and their wire 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. |
type, args: tuple[ object, ...]) -> type[ msgspec.Struct] | None:
(source)
¶
Select uniform struct items whose fields need no further preparation.
| Parameters | |
origin:type | Collection origin used to distinguish fixed and variadic tuples. |
args:tuple[object, ...] | Collection type arguments, already extracted by the caller. |
| Returns | |
type[msgspec.Struct] | None | Uniform struct type with an empty preparation plan, if applicable. |
object, schema: type[ msgspec.Struct], *, enabled: bool = False) -> object:
(source)
¶
Prepare marked values and existing structs using copy-on-write containers.
Existing struct constructors and mutations bypass native validation, so expand those instances before the final conversion. Unmarked scalar fields remain strict and schemas without preparation retain their original inputs.
| 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. |