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

Class Serializer No class docstring; 4/4 static methods documented
Function _dec_complex Decode a mapping payload into a complex number.
Function _dec_enum Reconstruct an enum member from its serialized class path and value.
Function _dec_frozenset Decode an iterable payload into a frozenset.
Function _dec_missing Return the singleton marker for missing values.
Function _dec_set Decode an iterable payload into a set.
Function _dec_timedelta Decode a mapping into a datetime.timedelta.
Function _dec_tuple Decode an iterable payload into a tuple.
Function _dec_type Resolve a dotted class path to the corresponding type object.
Function _decode Decode recursively serialized cache payloads into Python objects.
Function _encode Encode a Python object into a JSON-compatible structure.
Function _encode_subclass Encode subclass instances not covered by the exact-type dispatch table.
Function _identity Return o unchanged.
Constant _DECODE_DISPATCH Undocumented
Constant _ENCODE_EXACT Undocumented
Constant _TK Undocumented
Constant _VK Undocumented
def _dec_complex(v: Any) -> complex: (source)

Decode a mapping payload into a complex number.

Parameters
v:AnyMapping with real and imag components.
Returns
complexDecoded complex value.
def _dec_enum(val: dict) -> Any: (source)

Reconstruct an enum member from its serialized class path and value.

Parameters
val:dictMapping with "class" (dotted class path) and "value" keys.
Returns
AnyThe enum member corresponding to the encoded value.
def _dec_frozenset(v: Any) -> frozenset: (source)

Decode an iterable payload into a frozenset.

Parameters
v:AnyEncoded iterable of frozenset elements.
Returns
frozensetFrozen set with recursively decoded elements.
def _dec_missing(_: Any) -> Any: (source)

Return the singleton marker for missing values.

Parameters
_:AnyIgnored encoded payload.
Returns
AnyThe MISSING sentinel.
def _dec_set(v: Any) -> set: (source)

Decode an iterable payload into a set.

Parameters
v:AnyEncoded iterable of set elements.
Returns
setSet with recursively decoded elements.
def _dec_timedelta(v: Any) -> datetime.timedelta: (source)

Decode a mapping into a datetime.timedelta.

Parameters
v:AnyMapping of timedelta constructor fields.
Returns
datetime.timedeltaDecoded time delta value.
def _dec_tuple(v: Any) -> tuple: (source)

Decode an iterable payload into a tuple.

Parameters
v:AnyEncoded iterable of tuple elements.
Returns
tupleTuple with recursively decoded elements.
def _dec_type(val: str) -> Any: (source)

Resolve a dotted class path to the corresponding type object.

Parameters
val:strFully qualified class name, e.g. "module.submodule.ClassName".
Returns
AnyThe class object referenced by val.
def _decode(obj: Any) -> Any: (source)

Decode recursively serialized cache payloads into Python objects.

Parameters
obj:AnyValue produced by the serializer, including nested lists and mappings.
Returns
AnyDecoded Python object, with typed payload wrappers resolved via _DECODE_DISPATCH.
Raises
ValueErrorIf a serialized type key is present but has no registered decoder.
def _encode(obj: Any) -> Any: (source)

Encode a Python object into a JSON-compatible structure.

Dispatch to _ENCODE_EXACT for known types via O(1) hash lookup; fall back to fast-path dict/list handling, then _encode_subclass for all remaining cases.

Parameters
obj:AnyThe Python object to encode.
Returns
AnyA JSON-serialisable representation of obj.
Raises
TypeErrorIf obj is of an unsupported type.
def _encode_subclass(obj: Any, t: type) -> Any: (source)

Encode subclass instances not covered by the exact-type dispatch table.

Walk a priority-ordered chain of isinstance checks to handle Path subclasses, datetime hierarchy, collection subclasses, and sentinel values. Raises TypeError for unsupported types.

Parameters
obj:AnyObject whose type is not present in _ENCODE_EXACT.
t:typetype(obj), passed by the caller to avoid recomputing it.
Returns
AnyJSON-compatible representation of obj.
Raises
TypeErrorIf obj does not match any supported subclass or singleton.
def _identity(o: Any) -> Any: (source)

Return o unchanged.

Used as the encoder for primitive types (str, int, float, bool, None) that need no transformation before JSON serialisation.

Parameters
o:AnyValue to pass through.
Returns
AnyThe same object o, unmodified.
_DECODE_DISPATCH: dict[str, Callable[[Any], Any]] = (source)

Undocumented

Value
{'missing': _dec_missing,
 'path': Path,
 'bytes': base64.b64decode,
 'datetime': datetime.datetime.fromisoformat,
 'date': datetime.date.fromisoformat,
 'time': datetime.time.fromisoformat,
 'timedelta': _dec_timedelta,
...
_ENCODE_EXACT: dict[type, Callable[[Any], Any]] = (source)

Undocumented

Value
{str: _identity,
 int: _identity,
 float: _identity,
 bool: _identity,
 type(None): _identity,
 Path: (lambda o: {_TK: 'path', _VK: str(o)}),
 bytes: (lambda o: {_TK: 'bytes', _VK: base64.b64encode(o).decode()}),
...

Undocumented

Value
'__type__'

Undocumented

Value
'__value__'