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
Undocumented
| Static Method | __read |
Read a cache entry while its file lock is held. |
| Static Method | __temp |
Return a unique staging path for file. |
| Method | __create |
Write entry to file only when the file does not exist yet. |
| Method | __file |
Return the filesystem path for key. |
| Method | __increment |
Update a counter while holding its file lock. |
| Method | __init__ |
Initialize the backend and create the cache directory if needed. |
| Method | __lock |
Select the stable cross-process lock stripe for a cache file. |
| Method | __read |
Read and decode a cache file synchronously. |
| Method | __replace |
Replace a live entry while holding its cross-process lock. |
| Method | __replace |
Publish tmp as file, retrying a transient sharing violation. |
| Method | __unlink |
Remove file, ignoring missing-file errors. |
| Method | __write |
Publish a cache entry while its file lock is held. |
| Method | __write |
Atomically write entry to file via tmp-then-rename. |
| Async Method | add |
Store value under key only if the key does not already exist. |
| Async Method | clear |
Remove all cache entries from the store directory. |
| Async Method | delete |
Remove key from the store. |
| Async Method | exists |
Return True if key exists and has not expired. |
| Async Method | get |
Return the cached value for key, or default when absent/expired. |
| Async Method | increment |
Increment the integer stored at key by delta. |
| Async Method | multi |
Return a list of values for keys in the same order. |
| Async Method | multi |
Store multiple key/value pairs with an optional TTL. |
| Async Method | replace |
Replace an existing live key without recreating a deleted entry. |
| Async Method | set |
Store value under key with an optional TTL in seconds. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _counter |
Undocumented |
| Instance Variable | _locks |
Undocumented |
| Instance Variable | _path |
Undocumented |
| Instance Variable | _rename |
Undocumented |
| Property | lock |
Return the canonical directory used to identify cache locks. |
Read a cache entry while its file lock is held.
| Parameters | |
file:Path | Path to the cache entry. |
| Returns | |
dict | None | Live decoded entry, or None when missing, expired, or invalid. |
Select the stable cross-process lock stripe for a cache file.
| Parameters | |
file:Path | Cache file protected by the lock. |
| Returns | |
BaseFileLock | Platform lock shared by writes, replacement and deletion. |
Read and decode a cache file synchronously.
| Parameters | |
file:Path | Path to the cache file. |
| Returns | |
dict | None | Decoded entry, or None on any error. |
Store value under key only if the key does not already exist.
The entry is created with an exclusive open, so concurrent callers never both succeed and the operation is safe as a mutual-exclusion primitive.
| Parameters | |
key:str | Cache key. |
value:Any | Value to store. |
ttl:float | None | Optional TTL in seconds. |
| Returns | |
bool | True on success. |
| Raises | |
ValueError | If the key already exists and has not expired. |