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.

class documentation

class ICacheRepository(ABC): (source)

Known subclasses: orionis.cache.CacheRepository

View In Hierarchy

Undocumented

Async Method add Store value only if key does not already exist.
Async Method clear Remove all entries from the store.
Async Method decrement Decrement the integer stored at key by amount.
Async Method delete Remove key from the store.
Async Method get Retrieve the cached value for key.
Async Method getMany Retrieve multiple values at once.
Async Method has Check whether key exists and has not expired.
Async Method increment Increment the integer stored at key by amount.
Async Method pull Return and immediately delete key from the store.
Async Method remember Return the cached value; resolve and cache if absent.
Async Method rememberForever Return the cached value; resolve and cache forever if absent.
Async Method replace Replace a live entry atomically without creating a missing key.
Async Method set Store value under key with an optional TTL.
Async Method setMany Store multiple key/value pairs with an optional TTL.
Class Variable __slots__ Undocumented
@abstractmethod
async def add(self, key: str, value: Any, ttl: float | None = None) -> bool: (source)

Store value only if key does not already exist.

Parameters
key:strCache key.
value:AnyValue to store.
ttl:float | NoneOptional TTL in seconds.
Returns
boolTrue on success, False when the key already exists.
@abstractmethod
async def clear(self) -> bool: (source)

Remove all entries from the store.

Returns
boolTrue on success.
@abstractmethod
async def decrement(self, key: str, amount: int = 1) -> int: (source)

Decrement the integer stored at key by amount.

Parameters
key:strCache key.
amount:intAmount to subtract.
Returns
intNew value after decrement.
@abstractmethod
async def delete(self, key: str) -> bool: (source)

Remove key from the store.

Parameters
key:strCache key.
Returns
boolTrue if the key existed.
@abstractmethod
async def get(self, key: str) -> Any: (source)

Retrieve the cached value for key.

Parameters
key:strCache key.
Returns
AnyCached value, or None when absent.
@abstractmethod
async def getMany(self, keys: list[str]) -> dict[str, Any]: (source)

Retrieve multiple values at once.

Parameters
keys:list[str]Cache keys.
Returns
dict[str, Any]Mapping of key → value; missing keys map to None.
@abstractmethod
async def has(self, key: str) -> bool: (source)

Check whether key exists and has not expired.

Parameters
key:strCache key.
Returns
boolTrue if present and valid.
@abstractmethod
async def increment(self, key: str, amount: int = 1) -> int: (source)

Increment the integer stored at key by amount.

Parameters
key:strCache key.
amount:intAmount to add.
Returns
intNew value after increment.
@abstractmethod
async def pull(self, key: str) -> Any: (source)

Return and immediately delete key from the store.

Parameters
key:strCache key.
Returns
AnyCached value, or None when absent.
@abstractmethod
async def remember(self, key: str, ttl: float | None, resolver: Callable) -> Any: (source)

Return the cached value; resolve and cache if absent.

Parameters
key:strCache key.
ttl:float | NoneTTL applied when caching the resolved value.
resolver:CallableZero-argument callable (sync or async) producing the value.
Returns
AnyCached or freshly computed value.
@abstractmethod
async def rememberForever(self, key: str, resolver: Callable) -> Any: (source)

Return the cached value; resolve and cache forever if absent.

Parameters
key:strCache key.
resolver:CallableZero-argument callable (sync or async) producing the value.
Returns
AnyCached or freshly computed value.
@abstractmethod
async def replace(self, key: str, value: Any, ttl: float | None = None) -> bool: (source)

Replace a live entry atomically without creating a missing key.

Parameters
key:strCache key that must already exist.
value:AnyReplacement value.
ttl:float | NoneNew lifetime in seconds, or None for no expiry.
Returns
boolTrue when replaced; False when missing, expired or superseded.
@abstractmethod
async def set(self, key: str, value: Any, ttl: float | None = None) -> bool: (source)

Store value under key with an optional TTL.

Parameters
key:strCache key.
value:AnyValue to cache.
ttl:float | NoneTime-to-live in seconds. None means no expiry.
Returns
boolTrue on success.
@abstractmethod
async def setMany(self, values: dict[str, Any], ttl: float | None = None) -> bool: (source)

Store multiple key/value pairs with an optional TTL.

Parameters
values:dict[str, Any]Mapping of key → value.
ttl:float | NoneShared TTL in seconds.
Returns
boolTrue on success.
__slots__: tuple = (source)

Undocumented