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.
Encode and decode cache values with the configured serialization format.
| Class | |
Encode and decode cache values with the configured serialization format. |
| Function | _dec |
Decode a mapping payload into a complex number. |
| Function | _dec |
Reconstruct an enum member from its serialized class path and value. |
| Function | _dec |
Decode an iterable payload into a frozenset. |
| Function | _dec |
Return the singleton marker for missing values. |
| Function | _dec |
Decode an iterable payload into a set. |
| Function | _dec |
Decode a mapping into a datetime.timedelta. |
| Function | _dec |
Decode an iterable payload into a tuple. |
| Function | _dec |
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 |
Encode subclass instances not covered by the exact-type dispatch table. |
| Function | _identity |
Return o unchanged. |
| Constant | _DECODE |
keyed by the type string written by the encoder. |
| Constant | _ENCODE |
Map supported types to their encoder functions. |
| Constant | _TK |
Keys for type-discriminated payloads in the encoder output. |
| Constant | _VK |
__value__. |
Decode a mapping payload into a complex number.
| Parameters | |
v:typing.Any | Mapping with real and imag components. |
| Returns | |
complex | Decoded complex value. |
Reconstruct an enum member from its serialized class path and value.
| Parameters | |
val:dict | Mapping with "class" (dotted class path) and "value" keys. |
| Returns | |
typing.Any | The enum member corresponding to the encoded value. |
Decode an iterable payload into a frozenset.
| Parameters | |
v:typing.Any | Encoded iterable of frozenset elements. |
| Returns | |
frozenset | Frozen set with recursively decoded elements. |
Return the singleton marker for missing values.
| Parameters | |
_:typing.Any | Ignored encoded payload. |
| Returns | |
typing.Any | The MISSING sentinel. |
Decode an iterable payload into a set.
| Parameters | |
v:typing.Any | Encoded iterable of set elements. |
| Returns | |
set | Set with recursively decoded elements. |
Decode a mapping into a datetime.timedelta.
| Parameters | |
v:typing.Any | Mapping of timedelta constructor fields. |
| Returns | |
datetime.timedelta | Decoded time delta value. |
Decode an iterable payload into a tuple.
| Parameters | |
v:typing.Any | Encoded iterable of tuple elements. |
| Returns | |
tuple | Tuple with recursively decoded elements. |
Resolve a dotted class path to the corresponding type object.
| Parameters | |
val:str | Fully qualified class name, e.g. "module.submodule.ClassName". |
| Returns | |
typing.Any | The class object referenced by val. |
Decode recursively serialized cache payloads into Python objects.
| Parameters | |
obj:typing.Any | Value produced by the serializer, including nested lists and mappings. |
| Returns | |
typing.Any | Decoded Python object, with typed payload wrappers resolved via _DECODE_DISPATCH. |
| Raises | |
ValueError | If a serialized type key is present but has no registered decoder. |
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:typing.Any | The Python object to encode. |
| Returns | |
typing.Any | A JSON-serialisable representation of obj. |
| Raises | |
TypeError | If obj is of an unsupported type. |
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:typing.Any | Object whose type is not present in _ENCODE_EXACT. |
t:type | type(obj), passed by the caller to avoid recomputing it. |
| Returns | |
typing.Any | JSON-compatible representation of obj. |
| Raises | |
TypeError | If obj does not match any supported subclass or singleton. |
Return o unchanged.
Used as the encoder for primitive types (str, int, float, bool, None) that need no transformation before JSON serialisation.
| Parameters | |
o:typing.Any | Value to pass through. |
| Returns | |
typing.Any | The same object o, unmodified. |
keyed by the type string written by the encoder.
| Value |
|