Database-backed cache store (a pure-Python port of Rails' Solid Cache). No Redis required — runs on SQLite, PostgreSQL, or MySQL.
Project description
firm-cache
Database-backed caching for Python — a pure-Python port of Rails' Solid Cache. No Redis required: cache entries live in your existing SQLite, PostgreSQL, or MySQL/MariaDB database.
Part of firm, a port of the Rails 8 Solid stack.
pip install firm-cache
pip install "firm-cache[encryption]" # with at-rest encryption
Quickstart
from firm.cache import Cache
cache = Cache(database_url="postgresql://localhost/myapp")
cache.set("greeting", "hello")
cache.get("greeting") # "hello"
cache.fetch("expensive", lambda: compute()) # compute once, then cached
Highlights
- FIFO eviction by age, total size, or entry count — tuned in the background, like Solid Cache
- Pluggable coders — JSON (default), opt-in pickle, or msgpack via
firm-cache[msgpack] - At-rest encryption (Fernet) via
firm-cache[encryption] fetch,get_multi/set_multi,increment/decrement
Docs
MIT licensed. Schema and design derived from Solid Cache (© 37signals, MIT); see NOTICE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firm_cache-0.1.0.tar.gz.
File metadata
- Download URL: firm_cache-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4222bff2d113bbf8eebb5566f493af72ec421ad5feeeefd8166a5f6cee8ed5c
|
|
| MD5 |
15f076a046a463ad30e59227a9280d4b
|
|
| BLAKE2b-256 |
94a88ef9bb7f432ff49b4b6e95017d9f77f8bdb0ca3155093fb0cecf6f3dcc04
|
File details
Details for the file firm_cache-0.1.0-py3-none-any.whl.
File metadata
- Download URL: firm_cache-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093330319feb8099e7aa9ffb65eefb6cfb965531bec2d83472942e2640ecb8ed
|
|
| MD5 |
dcb7ab8c71a2e191741058dd513a033a
|
|
| BLAKE2b-256 |
d43f77e22078e8b3902a26ceadb08e80aefee41220004f2b128e943e80ab7928
|