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

class IRule(ABC): (source)

Known subclasses: orionis.schemas.rule.Rule

Constructor: IRule(message)

View In Hierarchy

Undocumented

Method __init__ Initialize the rule with an optional custom failure message.
Method enforce Evaluate whether the current value satisfies this rule.
Method validate Validate the provided value and return a failure or None.
Class Variable __slots__ Undocumented
def __init__(self, *, message: str | None = None): (source)

Initialize the rule with an optional custom failure message.

Parameters
message:str | None, optionalCustom message used for validation failures. If None, default messages are used.
Returns
NoneComplete the documented operation without returning a value.
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.
def validate(self, field: str, value: object, instance: object) -> ValidationFailure | None: (source)

Validate the provided value and return a failure or None.

Parameters
field:strName of the field being validated.
value:objectCurrent field value to validate.
instance:objectObject instance that owns the field.
Returns
ValidationFailure | NoneA failure describing the constraint violation, or None when the value is valid.
__slots__: tuple = (source)

Undocumented