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 DecimalPlaces(Rule): (source)
Constructor: DecimalPlaces(minimum, maximum, message)
Ensure a numeric value carries a given number of decimal places.
A single bound requires an exact number of places, while supplying maximum accepts any count within the inclusive range.
| Method | __init__ |
Initialize the rule with the accepted number of decimal places. |
| Async Method | enforce |
Validate a field value against the accepted decimal places. |
| Class Variable | __code__ |
decimal. |
| Class Variable | __message__ |
Value must have the required number of decimal places.. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _maximum |
Highest accepted number of decimal places. Defaults to minimum, which requires an exact count. |
| Instance Variable | _minimum |
Lowest accepted number of decimal places. |
Inherited from Rule:
| Method | __init |
Require asynchronous enforcement on every rule subclass. |
| Async Method | validate |
Validate the field by awaiting its asynchronous enforcement. |
| Instance Variable | _code |
Machine-readable status or error code. |
| Instance Variable | _message |
Override message used when validation fails. |
def __init__(self, minimum:
int, maximum: int | None = None, *, message: str | None = None):
(source)
¶
overrides
orionis.schemas.rule.Rule.__init__Initialize the rule with the accepted number of decimal places.
| Parameters | |
minimum:int | Lowest accepted number of decimal places. |
maximum:int | None, optional | Highest accepted number of decimal places. Defaults to minimum, which requires an exact count. |
message:str | None, optional | Override message used when validation fails. |
| Returns | |
None | No return value. |
| Raises | |
ValueError | If the bounds are negative or produce an empty range. |
overrides
orionis.schemas.rule.Rule.__slots__Declare the instance attribute slots reserved by this class.