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.
class SchemaMeta(_StructMeta): (source)
Constructor: SchemaMeta(name, bases, namespace, **kwargs)
Collect schema declarations and prepare their validation metadata.
| Static Method | _collect |
Collect application metadata from a newly created schema class. |
| Static Method | _compile |
Compile eager or string annotations before native conversion is cached. |
| Static Method | _wrap |
Wrap lazy annotation resolution with recursive metadata compilation. |
| Method | __new__ |
Build a Schema subclass with compiled metadata and rule plans. |
Collect application metadata from a newly created schema class.
Exclude native constraint metadata and internal message markers.
| Parameters | |
klass:type | Schema class whose field metadata is inspected. |
| Returns | |
dict[str, list[object]] | Field names mapped to their application metadata items, omitting fields with no such items. |
type, annotations: dict[ str, object], messages: dict[ str, dict[ str, str]]):
(source)
¶
Compile eager or string annotations before native conversion is cached.
| Parameters | |
klass:type | Newly created schema whose declaration does not use a lazy callback. |
annotations:dict[str, object] | Original local annotations, including any non-field declarations. |
messages:dict[str, dict[str, str]] | Mapping receiving local constraint and type messages. |
| Returns | |
None | No return value. |
Callable[ [ int], dict[ str, object]], constraint_msgs: dict[ str, dict[ str, str]]) -> Callable[ [ int], dict[ str, object]]:
(source)
¶
Wrap lazy annotation resolution with recursive metadata compilation.
| Parameters | |
originalcollections.abc.Callable[[int], dict[str, object]] | Original PEP 649 annotation callback. |
constraintdict[str, dict[str, str]] | Mapping populated with each field's local validation messages. |
| Returns | |
collections.abc.Callable[[int], dict[str, object]] | Callback that compiles metadata while preserving string requests. |
str, bases: tuple[ type, ...], namespace: dict[ str, object], **kwargs: object) -> SchemaMeta:
(source)
¶
Build a Schema subclass with compiled metadata and rule plans.
Compile lazy annotations, merge inherited messages and index errors by encoded field name before preparing the validation plan.
| Parameters | |
cls:type | Metaclass constructing the schema. |
name:str | Name of the schema class. |
bases:tuple[type, ...] | Direct base classes. |
namespace:dict[str, object] | Class body namespace. |
**kwargs:object | Options forwarded to the msgspec.Struct metaclass. |
| Returns | |
orionis.schemas.schema.SchemaMeta | Prepared schema class. |
| Raises | |
TypeError | If field metadata contains an unsupported rule declaration. |
orionis.schemas.compiler.MetadataConflictError | If constraint declarations are invalid or incompatible. |