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

Method __init__ Initialize the rule with an optional custom failure message.
Method enforce Evaluate whether the current value satisfies this rule.
Async Method enforceAsync Run an explicitly asynchronous rule check without blocking the loop.
Method validate Validate the field value and return a failure when invalid.
Async Method validateAsync Await the rule and describe an invalid field value.
Class Variable __slots__ Undocumented
Instance Variable _code Undocumented
Instance Variable _message Undocumented
def enforce(self, field: str, value: object, instance: object) -> bool: (source)

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.
async def enforceAsync(self, field: str, value: object, instance: object) -> bool: (source)

Run an explicitly asynchronous rule check without blocking the loop.

Notes

Rules with native asynchronous I/O should override this method. Schema plans call ordinary synchronous rules directly, without using a worker.

Parameters
field:strField name associated with the value.
value:objectCurrent field value to validate.
instance:objectSchema instance owning the field value.
Returns
boolWhether the synchronous rule accepts the value in a worker thread.
def validate(self, field: str, value: object, instance: object) -> ValidationFailure | None: (source)

Validate the field value and return a failure when invalid.

Parameters
field:strField name associated with value.
value:objectCurrent field value to validate.
instance:objectSchema instance that owns the field value.
Returns
ValidationFailure | NoneFailure details when validation fails; otherwise None.
async def validateAsync(self, field: str, value: object, instance: object) -> ValidationFailure | None: (source)

Await the rule and describe an invalid field value.

Parameters
field:strField name associated with the value.
value:objectCurrent field value to validate.
instance:objectSchema instance owning the field value.
Returns
ValidationFailure | NoneFailure details when validation fails, otherwise None.

Undocumented

_message: str | None = (source)

Undocumented