Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.0.1 instead.
Reason given by maintainers: No ready, published wrong version

diskcache-oxide: Python cache. Rust engine. SQLite storage.

diskcache-oxide

A shared, durable cache for Python apps, rebuilt in Rust for many cores, many processes and free-threaded Python.

Almost every Python web app ends up needing a cache that all of its worker processes can see. An in-memory dict isn't shared and dies on restart. Redis is one more server to run. python-diskcache made the middle path popular: a cache that is just a directory, shared by every thread and process on the machine. diskcache-oxide keeps diskcache's API and rebuilds everything underneath: a Rust engine, SQLite storage, and the thinnest possible Python layer.

Docs: https://mkennedy.codes/docs/diskcache-oxide/

from diskcache_oxide import Cache

cache = Cache('/var/cache/my-app')  # every worker opens the same directory

cache.set('episodes:popular', episodes, expire=300)
episodes = cache.get('episodes:popular')

# Only one worker runs the hourly job: add() is atomic across processes.
if cache.add('job:refresh-feeds', os.getpid(), expire=3600):
    refresh_feeds()

Status: pre-release, not yet published. The core Cache works, and it passes the conformance suite run against real diskcache, apart from the documented divergences. It's now in a deep concurrency review and 24-hour soak runs, then production at Talk Python, before a first release.

Why

  • Fast. A cached get is about 0.75 µs, 0.42× diskcache's latency. With 8 threads at a 99:1 read/write mix, it handles 16× diskcache's throughput on a GIL build.
  • Safe for threads, processes and fork(), including free-threaded Python (3.14t, 3.15t). A child forked while another thread was writing can always write; in diskcache it can stall for a minute.
  • No pickle by default. Values are stored as msgpack (or JSON), with exact type tags for tuples, sets, datetimes, big ints and NaN. pickle=True is opt-in, and a cache without it refuses to unpickle anything it finds.
  • Correct under pressure. clear() keeps writes that land while it runs, expire() removes every expired entry, and a read during an overwrite never misses. Each is a diskcache bug with a repro in upstream/.
  • Bounded memory: at most max_connections SQLite connections per cache directory, each with a page cache of sqlite_cache_size pages (1 MiB by default).
  • Predictable disk use: the write-ahead log trims itself back to wal_size_limit / 2 (32 MiB by default) whenever it resets, and checkpoint() truncates it on demand.
  • Type hints included (py.typed), and a NullCache that turns caching off without changing call sites.

Where it's going

  1. A better diskcache (now): the Cache above.
  2. The complete local caching toolkit: free-threaded scaling, FanoutCache, AsyncCache, memoize, tags, transact(), Deque/Index, and recipes like locks and throttles that are atomic across every process on the machine.
  3. A cache server: the same Rust engine served over the network, a Redis-style central cache with SQLite underneath.

See Vision and roadmap in the docs.

Shutting down

Call cache.checkpoint() at shutdown if you can, though it isn't required. With readers in other processes, a burst of writes (a big fill, or a clear()) can leave SQLite's write-ahead log much larger than the database, and SQLite only shrinks it when it gets a moment with no readers. checkpoint() makes that moment: it waits briefly for in-flight reads, copies the log into the database, and truncates it. It returns False instead of raising if other processes keep it busy.

close() does the same by default, but only when the log is large (over half of wal_size_limit), and waits at most a second, so closing stays cheap. Pass close(checkpoint=False) to skip it. Long-running apps with heavy write bursts can also call checkpoint() from a maintenance job, or opt in to Cache(..., wal_checkpoint="auto") (see D-024 in tests/DIVERGENCES.md).

Where things are

  • plans/00-roadmap.md: the phases and what each one delivers.
  • plans/04-design.md: the design.
  • tests/DIVERGENCES.md: every deliberate difference from diskcache, and why.
  • upstream/README.md: diskcache bugs found along the way, with standalone repros.
  • scripts/check.sh: everything CI would run, locally, on Python 3.14, 3.14t, 3.15 and 3.15t.
  • make docs: builds the docs site into site/.

Metadata

Release files for diskcache-oxide 0.1.0.dev1

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

Built distributions (wheels)

Table of built distributions (wheels) for diskcache-oxide 0.1.0.dev1
File Interpreter ABI Platform Actions
diskcache_oxide-0.1.0.dev1-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for diskcache_oxide-0.1.0.dev1-cp314-cp314t-macosx_11_0_arm64.whl
diskcache_oxide-0.1.0.dev1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for diskcache_oxide-0.1.0.dev1-cp314-cp314-macosx_11_0_arm64.whl

Total release size: 3.3 MB

Release files / diskcache_oxide-0.1.0.dev1-cp314-cp314t-macosx_11_0_arm64.whl

Download URL diskcache_oxide-0.1.0.dev1-cp314-cp314t-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f30999e2bb4e8f04a1c468b3dc56e25d13869d205f81279a03952c876df4b13b
BLAKE2b-256 checksum
How to use checksums
3860cb0f2a63dd9256926dd4b29ce1278afd6eb512f3a4ef544b6a9d06280ea9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / diskcache_oxide-0.1.0.dev1-cp314-cp314-macosx_11_0_arm64.whl

Download URL diskcache_oxide-0.1.0.dev1-cp314-cp314-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
34cb2e7bdd1bf7a9a2b40541bc7d87d1a772bf497e7fcdd42101ef0e58526a80
BLAKE2b-256 checksum
How to use checksums
14fdf570faba828ee323f306e6b6894ef649b13925920cea8d202f1e896caee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for diskcache-oxide 0.1.0.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0.dev1 This release

2 release files No provenance

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