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

Define a reusable validation rule and its failure message.

Method __init__ Initialize the rule with an optional custom failure message.
Method __init_subclass__ Require asynchronous enforcement on every rule subclass.
Async Method enforce Asynchronously evaluate whether the current value satisfies this rule.
Async Method validate Validate the field by awaiting its asynchronous enforcement.
Class Variable __slots__ Restrict rule instances to their declared attributes.
Instance Variable _code Machine-readable status or error code.
Instance Variable _message Override message used when validation fails.
def __init_subclass__(cls, **kwargs: object): (source)

Require asynchronous enforcement on every rule subclass.

Parameters
cls:typeSubclass being initialized.
**kwargs:objectClass options forwarded to the next base class.
Returns
NoneNo return value.
Raises
TypeErrorIf a subclass declares synchronous enforcement.
async def enforce(self, field: str, value: object, instance: object) -> bool: (source)

Asynchronously evaluate whether the current value satisfies this rule.

Parameters
field:strField name associated with value.
value:objectCurrent field value to validate.
instance:objectSchema instance that owns the field value.
Returns
boolReturn True when the value passes validation.
Raises
NotImplementedErrorIf a subclass does not provide its own enforcement implementation.
async def validate(self, field: str, value: object, instance: object) -> ValidationFailure | None: (source)

Validate the field by awaiting its asynchronous enforcement.

Parameters
field:strField name associated with value.
value:objectCurrent field value to validate.
instance:objectSchema instance that owns the field value.
Returns
orionis.schemas.entities.failure.ValidationFailure | NoneFailure details when validation fails; otherwise None.

Machine-readable status or error code.

_message: str | None = (source)

Override message used when validation fails.