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.
module documentation
Undocumented
| Function | _enum |
Index enum names and values in declaration order. |
| Function | copy |
Validate a list of non-empty strings and return an independent copy. |
| Function | normalize |
Normalize an enum member, member name, or string value. |
| Function | validate |
Require a boolean without coercing truthy values. |
| Function | validate |
Validate a cookie name with the HTTP response serializer. |
| Function | validate |
Require the driver implemented by a connection entity. |
| Function | validate |
Require an explicit serialized HTTP(S) origin without wildcards. |
| Function | validate |
Validate an integer within an inclusive range. |
| Function | validate |
Require a safe connection, queue, or SQL table identifier. |
| Function | validate |
Require finite nonnegative or strictly positive seconds. |
| Function | validate |
Validate a string and optionally allow blank values. |
| Constant | _ENUM |
Undocumented |
| Constant | _NAME |
Undocumented |
| Constant | _TABLE |
Undocumented |
@lru_cache( maxsize=64)
def _enum_values(enum_type: type[ Enum], _member_count: int) -> MappingProxyType | None:
(source)
¶
Index enum names and values in declaration order.
| Parameters | |
enumtype[Enum] | Enum class defining the accepted names and values. |
_memberint | Number of declared names, including aliases, used as a cache revision. |
| Returns | |
MappingProxyType or None | Read-only scalar lookup preserving declaration order, or None when values require their current string representation on every lookup. |
Validate a list of non-empty strings and return an independent copy.
| Parameters | |
value:object | List to validate and copy. |
name:str | Field name used in validation errors. |
| Returns | |
list[str] | A new list containing the validated strings. |
| Raises | |
TypeError | If value is not a list or an item is not a string. |
ValueError | If an item is blank. |
Normalize an enum member, member name, or string value.
| Parameters | |
value:object | Enum member, member name, or string value to normalize. |
enumtype[Enum] | Enum class that defines the accepted members. |
name:str | Field name used in validation errors. |
| Returns | |
object | The normalized enum member value. |
| Raises | |
TypeError | If value is neither an enum member nor a string. |
ValueError | If the string does not match an enum member or value. |
Validate a cookie name with the HTTP response serializer.
| Parameters | |
value:object | Cookie name to validate. |
name:str | Field name used in validation errors. |
| Returns | |
None | This function validates the name without returning a result. |
| Raises | |
TypeError | If value is not a non-empty string. |
ValueError | If the serializer rejects value as a cookie name. |
Require the driver implemented by a connection entity.
| Parameters | |
value:object | Configured driver name or enum member. |
expected:Drivers | Driver supported by the entity. |
| Returns | |
None | Validate the driver without changing its representation. |
| Raises | |
TypeError | If the driver is not a string or string enum. |
ValueError | If the driver does not match the connection entity. |
Require an explicit serialized HTTP(S) origin without wildcards.
| Parameters | |
origin:str | One trusted browser origin from configuration. |
| Returns | |
None | Accept the validated origin without changing its spelling. |
| Raises | |
TypeError | If the configured origin is not a string. |
ValueError | If its syntax could permit ambiguous or unrestricted matching. |
def validate_integer(value:
object, name: str, *, minimum: int = 0, maximum: int | None = None):
(source)
¶
Validate an integer within an inclusive range.
| Parameters | |
value:object | Value to validate. |
name:str | Field name used in validation errors. |
minimum:int, optional | Minimum allowed value, inclusive. |
maximum:int | None, optional | Maximum allowed value, inclusive, or None for no upper bound. |
| Returns | |
None | This function validates the value without returning a result. |
| Raises | |
TypeError | If value is not an integer or is a boolean. |
ValueError | If value is outside the configured range. |
Require a safe connection, queue, or SQL table identifier.
| Parameters | |
value:object | Identifier to validate. |
name:str | Configuration field used in errors. |
table:bool, optional | Restrict the identifier to an unqualified SQL table name. |
| Returns | |
None | Validate the identifier without changing it. |
| Raises | |
TypeError | If the identifier is not a string. |
ValueError | If the identifier is empty or unsafe. |
Require finite nonnegative or strictly positive seconds.
| Parameters | |
value:object | Numeric duration to validate. |
name:str | Configuration field used in errors. |
positive:bool, optional | Reject zero when true. |
| Returns | |
None | Validate the duration without coercion. |
| Raises | |
TypeError | If the duration is not numeric or is a boolean. |
ValueError | If the duration is nonfinite or outside its allowed range. |
Validate a string and optionally allow blank values.
| Parameters | |
value:object | Value to validate. |
name:str | Field name used in validation errors. |
allowbool, optional | Whether to allow strings containing only whitespace. |
| Returns | |
None | This function validates the value without returning a result. |
| Raises | |
TypeError | If value is not a string. |
ValueError | If value is blank and empty strings are not allowed. |