ORIONIS API REFERENCE

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 documentation

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.
def _collect(klass: type) -> dict[str, list[object]]: (source)

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:typeThe 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.
def _wrap(original_func: 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
original_func:Callable[[int], dict[str, object]]Provide the original PEP 649 annotation callback.
constraint_msgs:dict[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.
def __new__(cls, name: 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:typeProvide the metaclass itself.
name:strDefine the class name.
bases:tuple[type, ...]Define the direct base classes.
namespace:dict[str, object]Provide the class body namespace.
**kwargs:objectForward metaclass keyword arguments to msgspec.Struct.
Returns
SchemaMetaReturn the created schema class.