SciQLop CacheΒΆ
A fast, persistent, process-safe key-value cache for Python, with a C++20 core.
Think of it as a tiny local database for things that are expensive to compute or to download. You store Python objects under keys, and any thread or process on the machine can read them back, safely, even at the same time. Data survives restarts. The cache can be bounded in size, entries can expire, and nothing gets corrupted when processes crash, fork, or race each other.
from pysciqlop_cache import Cache
cache = Cache("my-cache")
cache["sensor/temperature"] = {"ts": 1710000000, "values": [21.3, 21.5, 21.4]}
print(cache["sensor/temperature"])
# {'ts': 1710000000, 'values': [21.3, 21.5, 21.4]}
$ pip install pysciqlop-cache
It follows the diskcache API, so most diskcache code runs unchanged, and it is 2x faster on writes and up to 6x faster in batched transactions.
What do you want to do?ΒΆ
Store and fetch values like in a dict, with expiration, size limits and one-line memoization of your functions.
Worker pools, forked processes, GUI threads: transactions, locks, and what is safe to do at the same time.
Measurement series, images, spectrograms: write them without blocking your other threads, and let the cache compress what compresses well.
Cache, Index, FanoutCache or FanoutIndex: what each one is
for.
Migrate an existing cache in one command, and see where the two APIs still differ.
The same engine, header-only, from C++20.
Getting started
Guides
Reference