klepto
persistent caching to memory, disk, or database
Decision gist · record as of 2026-08-14
Yes. klepto is actively maintained, has low install friction, carries a permissive license, and fills a genuine gap for persistent, multi-algorithm caching in distributed settings. It's stable (Production/Stable status) with no known vulnerabilities. Install it if you need caching beyond functools.lru_cache or persistent result archiving; skip it if simple in-memory caching suffices.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.9; optional backends (HDF5, SQL) require additional dependencies.
- Low friction install with only two runtime dependencies (pox and dill).
- Actively maintained with recent commits and stable production status.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution and license notice required.
last release 2026-01-19 (207 days) · last repo commit 2026-06-22 · 277 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 96,083 downloads/mo, #13,232 on PyPI
Alternatives
Verify before relying
pip install klepto
from klepto.caches import lru_cache
@lru_cache()
def expensive_function(x):
return x ** 2
result = expensive_function(5)- Performance characteristics compared to functools.lru_cache for typical workloads
- Thread/process safety guarantees for concurrent access to persisted caches
- Serialization overhead when using different keymaps (hashmap, picklemap, stringmap)
What it is and what it does
klepto extends Python's standard caching with multiple replacement strategies and persistent storage backends. It provides LRU, LFU, MRU, and random-replacement caching algorithms, each available in standard and "safe" variants that recover from hashing errors. Beyond in-memory caching, klepto archives function results to files, SQL databases, or HDF5 files using a dictionary-style interface, enabling cache reuse across interpreter sessions.
The package is designed for distributed and parallel computing where caches need to be shared across threads and processes. It uses keymaps to convert function arguments into cache keys, supporting raw objects, hashes, strings, or serialized forms. klepto depends on dill for serialization and pox for utilities, and is part of the larger pathos framework for heterogeneous computing.
Use it for
- Cache expensive computations across multiple Python sessions by saving results to disk or database
- Decorate functions in distributed workflows where multiple workers need access to the same cached results
- Implement custom caching strategies (LFU, MRU) instead of only LRU for domain-specific performance tuning
- Archive function call results to SQL or HDF5 for long-term storage and analysis
- Build fault-tolerant parallel applications that can recover cached state after restart
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
klepto is actively maintained, has low install friction, carries a permissive license, and fills a genuine gap for persistent, multi-algorithm caching in distributed settings. It's stable (Production/Stable status) with no known vulnerabilities. Install it if you need caching beyond functools.lru_cache or persistent result archiving; skip it if simple in-memory caching suffices.
Install
klepto on PyPI
Before you install
Low friction install with only two runtime dependencies (pox and dill). Actively maintained with recent commits and stable production status.
Requires Python >=3.9; optional backends (HDF5, SQL) require additional dependencies.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution and license notice required.
Quickstart
pip install klepto
from klepto.caches import lru_cache
@lru_cache()
def expensive_function(x):
return x ** 2
result = expensive_function(5)
Verify before relying
- Performance characteristics compared to functools.lru_cache for typical workloads
- Thread/process safety guarantees for concurrent access to persisted caches
- Serialization overhead when using different keymaps (hashmap, picklemap, stringmap)
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespoxdill |
| Maintenance | Actively maintained 207 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,083 / month, #13,232 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DatabaseTopic :: Scientific/EngineeringTopic :: Software Development |
Evidence: klepto-0.2.8-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “distributed caching archive”
- kleptoklepto provides multiple caching algorithms (LRU, LFU, MRU,…
- webdatasetWebDataset reads and streams large-scale training data from tar-based…
- fastdownloadDownloads, verifies, and extracts archives from URLs with automatic…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also memoization · cachetools · cache-to-disk · methodtools · cached_method · cachier · backports.functools-lru-cache · django-memoize · asyncache · diskcache