python-flowmaticcache
A small cache abstraction for Python, with pluggable backends: Redis, Valkey, flowmaticdb and an in-process shared-memory store.
Install
pip install flowmaticcache # shared_memory works out of the box
pip install "flowmaticcache[redis]" # Redis
pip install "flowmaticcache[valkey]" # Valkey
pip install "flowmaticcache[flowmaticdb]" # flowmaticdb-backed cache table
pip install "flowmaticcache[all]" # every backend
pip install "flowmaticcache[dev]" # pytest, mypy, ruff + all backends
Usage
from flowmaticcache import Cache
cache = Cache.shared_memory()
# cache = Cache.connect_redis(host="localhost", port=6379)
# cache = Cache.connect_valkey(host="localhost", port=6380)
# cache = Cache.connect_flowmaticdb(db, table="cache")
cache.set("key", {"any": "picklable value"}, ttl=60) # ttl in seconds, optional
cache.get("key")
cache.exists("key")
cache.delete("key")
cache.clear()
Testing
Redis and Valkey tests run against local containers:
docker compose up -d
pip install -e ".[dev]"
pytest
Database-backed tests use flowmaticdb's in-memory SQLite adapter, so no
external service is required for those.
Publishing
./build-and-publish.sh
Reads PYPI_API_KEY from .env (see .env.example), builds the package and
uploads it to PyPI after confirmation.
Release files for flowmaticcache 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flowmaticcache-0.1.0.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flowmaticcache-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / flowmaticcache-0.1.0.tar.gz
| Download URL | flowmaticcache-0.1.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79236cbc5713e314fc43d829f3faceb2b30006d06c7c6b7029b19cbae3c40a0c
|
|
BLAKE2b-256 checksum How to use checksums |
1dcd7307c28effe88d2c8b4b1eb0108f35fa9986c46547c6a6bd14b0363728ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / flowmaticcache-0.1.0-py3-none-any.whl
| Download URL | flowmaticcache-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49aed51359692fa050957a30a2253aababbe7a5779b34f88c620da3bdd2a265a
|
|
BLAKE2b-256 checksum How to use checksums |
c6f2d12a3625094186be013cdaadaa04d86ae6841143f011c8b632d1a841a478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|