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 Serializer: (source)
Encode and decode cache values with the configured serialization format.
| Static Method | dumps |
Serialize an object to a JSON-formatted string. |
| Static Method | dump |
Write serialized data to a file atomically. |
| Static Method | load |
Load and deserialize data from a file. |
| Static Method | loads |
Deserialize a JSON-formatted string to a Python object. |
Serialize an object to a JSON-formatted string.
| Parameters | |
data:typing.Any | The object to serialize. |
indent:int or None, optional | Number of spaces for indentation in the output JSON string. |
| Returns | |
str | The JSON-formatted string representing the serialized object. |
Write serialized data to a file atomically.
| Parameters | |
data:typing.Any | The object to serialize and write. |
filepathlib.Path | The file path where the serialized data will be written. |
| Returns | |
None | This method does not return a value. |
| Raises | |
OSError | If the payload cannot be staged or renamed into place. |
Load and deserialize data from a file.
| Parameters | |
filepathlib.Path | Path to the file from which to load and deserialize data. |
| Returns | |
typing.Any | The deserialized Python object, or None if the file does not exist or is empty. |
Deserialize a JSON-formatted string to a Python object.
| Parameters | |
raw:str or bytes | JSON-formatted string to deserialize. |
| Returns | |
typing.Any | The deserialized Python object. |