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)
Undocumented
| Static Method | _collect |
Collect custom non-msgspec metadata from a freshly created struct. |
| Static Method | _wrap |
Return a wrapped annotate callable for the Python 3.14 lazy protocol. |
| Method | __new__ |
Build a new Schema subclass with compiled metadata. |
Collect custom non-msgspec metadata from a freshly created struct.
Iterate over each field of klass and collect Annotated arguments that are not msgspec.Meta instances into a field_name -> [custom_items] mapping.
| Parameters | |
klass:type | The newly created Schema subclass. |
| Returns | |
dict[str, list[object]] | A mapping of field names to their custom metadata objects. Fields with no custom metadata are omitted. |
Callable[ [ int], dict[ str, object]], constraint_msgs: dict[ str, dict[ str, str]]) -> Callable[ [ int], dict[ str, object]]:
(source)
¶
Return a wrapped annotate callable for the Python 3.14 lazy protocol.
Call the original annotate function to obtain raw annotations, compile ValidationMetadata items into msgspec.Meta, and extract custom error messages into constraint_msgs.
Capture module-level globals as closure locals so the inner _annotate uses LOAD_DEREF rather than LOAD_GLOBAL.
| Parameters | |
originalCallable[[int], dict[str, object]] | Provide the original PEP 649 annotation callback. |
constraintdict[str, dict[str, str]] | Store per-field custom error messages keyed by constraint name. |
| Returns | |
Callable[[int], dict[str, object]] | Return the wrapped annotation callback. |
str, bases: tuple[ type, ...], namespace: dict[ str, object], **kwargs: object) -> SchemaMeta:
(source)
¶
Build a new Schema subclass with compiled metadata.
Wrap __annotate_func__ (PEP 649) so ValidationMetadata objects become msgspec.Meta instances, then attach __orionis_meta__ and __orionis_constraints__ to the finished class.
| Parameters | |
cls:type | Provide the metaclass itself. |
name:str | Define the class name. |
bases:tuple[type, ...] | Define the direct base classes. |
namespace:dict[str, object] | Provide the class body namespace. |
**kwargs:object | Forward metaclass keyword arguments to msgspec.Struct. |
| Returns | |
SchemaMeta | Return the created schema class. |