Skip to main content

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.

Metadata

Release files for firm-cache 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firm-cache 1.0.0
File Size Uploaded
firm_cache-1.0.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for firm-cache 1.0.0
File Interpreter ABI Platform
firm_cache-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / firm_cache-1.0.0.tar.gz

Download URL firm_cache-1.0.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
846e7bbea79ffd3c71b27ba16c2404c70cf62e8e9abd323a7f90eac690e49592
BLAKE2b-256 checksum
How to use checksums
d59d53f8b517e334f326e9fd6bf7d53f85bca2451e6aacc06c6764825f1bc75f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

Release files / firm_cache-1.0.0-py3-none-any.whl

Download URL firm_cache-1.0.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d624507e7188e21fc3879812f6f38c8aab54cfdd87d721db7bd8b71f7979090
BLAKE2b-256 checksum
How to use checksums
baeccd2f5f64393d631c540cc022a7192ea4c08d38a22b4ef03900b25a755b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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}

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page