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.

module documentation

Undocumented

Function _enum_values Index enum names and values in declaration order.
Function copy_string_list Validate a list of non-empty strings and return an independent copy.
Function normalize_enum Normalize an enum member, member name, or string value.
Function validate_boolean Require a boolean without coercing truthy values.
Function validate_cookie_name Validate a cookie name with the HTTP response serializer.
Function validate_driver Require the driver implemented by a connection entity.
Function validate_http_origin Require an explicit serialized HTTP(S) origin without wildcards.
Function validate_integer Validate an integer within an inclusive range.
Function validate_name Require a safe connection, queue, or SQL table identifier.
Function validate_seconds Require finite nonnegative or strictly positive seconds.
Function validate_string Validate a string and optionally allow blank values.
Constant _ENUM_SCALAR_TYPES Undocumented
Constant _NAME_PATTERN Undocumented
Constant _TABLE_PATTERN 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
enum_type:type[Enum]Enum class defining the accepted names and values.
_member_count:intNumber of declared names, including aliases, used as a cache revision.
Returns
MappingProxyType or NoneRead-only scalar lookup preserving declaration order, or None when values require their current string representation on every lookup.
def copy_string_list(value: object, name: str) -> list[str]: (source)

Validate a list of non-empty strings and return an independent copy.

Parameters
value:objectList to validate and copy.
name:strField name used in validation errors.
Returns
list[str]A new list containing the validated strings.
Raises
TypeErrorIf value is not a list or an item is not a string.
ValueErrorIf an item is blank.
def normalize_enum(value: object, enum_type: type[Enum], name: str) -> object: (source)

Normalize an enum member, member name, or string value.

Parameters
value:objectEnum member, member name, or string value to normalize.
enum_type:type[Enum]Enum class that defines the accepted members.
name:strField name used in validation errors.
Returns
objectThe normalized enum member value.
Raises
TypeErrorIf value is neither an enum member nor a string.
ValueErrorIf the string does not match an enum member or value.
def validate_boolean(value: object, name: str): (source)

Require a boolean without coercing truthy values.

Parameters
value:objectValue to validate.
name:strField name used in validation errors.
Returns
NoneThis function validates the value without returning a result.
Raises
TypeErrorIf value is not a boolean.
def validate_cookie_name(value: object, name: str): (source)

Validate a cookie name with the HTTP response serializer.

Parameters
value:objectCookie name to validate.
name:strField name used in validation errors.
Returns
NoneThis function validates the name without returning a result.
Raises
TypeErrorIf value is not a non-empty string.
ValueErrorIf the serializer rejects value as a cookie name.
def validate_driver(value: object, expected: Drivers): (source)

Require the driver implemented by a connection entity.

Parameters
value:objectConfigured driver name or enum member.
expected:DriversDriver supported by the entity.
Returns
NoneValidate the driver without changing its representation.
Raises
TypeErrorIf the driver is not a string or string enum.
ValueErrorIf the driver does not match the connection entity.
def validate_http_origin(origin: str): (source)

Require an explicit serialized HTTP(S) origin without wildcards.

Parameters
origin:strOne trusted browser origin from configuration.
Returns
NoneAccept the validated origin without changing its spelling.
Raises
TypeErrorIf the configured origin is not a string.
ValueErrorIf 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:objectValue to validate.
name:strField name used in validation errors.
minimum:int, optionalMinimum allowed value, inclusive.
maximum:int | None, optionalMaximum allowed value, inclusive, or None for no upper bound.
Returns
NoneThis function validates the value without returning a result.
Raises
TypeErrorIf value is not an integer or is a boolean.
ValueErrorIf value is outside the configured range.
def validate_name(value: object, name: str, *, table: bool = False): (source)

Require a safe connection, queue, or SQL table identifier.

Parameters
value:objectIdentifier to validate.
name:strConfiguration field used in errors.
table:bool, optionalRestrict the identifier to an unqualified SQL table name.
Returns
NoneValidate the identifier without changing it.
Raises
TypeErrorIf the identifier is not a string.
ValueErrorIf the identifier is empty or unsafe.
def validate_seconds(value: object, name: str, *, positive: bool = False): (source)

Require finite nonnegative or strictly positive seconds.

Parameters
value:objectNumeric duration to validate.
name:strConfiguration field used in errors.
positive:bool, optionalReject zero when true.
Returns
NoneValidate the duration without coercion.
Raises
TypeErrorIf the duration is not numeric or is a boolean.
ValueErrorIf the duration is nonfinite or outside its allowed range.
def validate_string(value: object, name: str, *, allow_empty: bool = False): (source)

Validate a string and optionally allow blank values.

Parameters
value:objectValue to validate.
name:strField name used in validation errors.
allow_empty:bool, optionalWhether to allow strings containing only whitespace.
Returns
NoneThis function validates the value without returning a result.
Raises
TypeErrorIf value is not a string.
ValueErrorIf value is blank and empty strings are not allowed.
_ENUM_SCALAR_TYPES = (source)

Undocumented

Value
frozenset(set([str, bytes, int, float, complex, bool, type(None)]))
_NAME_PATTERN = (source)

Undocumented

Value
re.compile(r'[A-Za-z0-9][A-Za-z0-9_\.-]{,127}')
_TABLE_PATTERN = (source)

Undocumented

Value
re.compile(r'[A-Za-z_]\w*',
           re.ASCII)