cachey
Caching mindful of computation/storage costs
What it is and what it does
Cachey is a caching library designed for analytic computations where standard policies like LRU are ineffective because computation and storage costs vary wildly. It scores cached items based on their recomputation cost, storage size, frequency of use, and recency, keeping results that are expensive to recompute but cheap to store while evicting cheap-to-recompute but large results. The package provides a Cache class for manual cache management and a memoize decorator for automatic function result caching.
The library targets scientific and data-analysis workflows where a single computation might be costly but yield a small result, while another might be cheap but produce large data. It accomplishes this through a scoring formula that balances these trade-offs with exponential decay of old items. However, the package is no longer maintained—its last release was in 2020 and the last commit in early 2021—so it receives no updates, bug fixes, or compatibility improvements.
Use it for:
- Cache expensive computations that produce small results in analytical workflows.
- Memoize costly data-processing functions in analytical pipelines where storage is limited.
- Manage memory in long-running data science workflows by automatically evicting cheap-to-recompute intermediate results.
- Optimize task graphs or similar lazy-evaluation systems where computation cost varies widely.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cachey provides intelligent caching for analytic computations, prioritizing results that are expensive to recompute, cheap to store, and frequently used, rather than using simple LRU policies.
No. While the package has low install friction and addresses a real problem in analytic computing, it is abandoned and unmaintained. The last release was in 2020, the last commit in 2021, and no security or compatibility updates are forthcoming. For new projects, use an actively maintained alternative; for existing code already using cachey, consider migration to reduce technical debt.
Install
cachey on PyPI
pip
pip install cacheyuv
uv add cacheypoetry
poetry add cacheyInstalling cachey
Before you install
Low install friction with a single dependency (heapdict). However, the package is abandoned—last commit was 2021-02-10 and no releases since 2020-03-11—so maintenance and bug fixes are not forthcoming.
License in practice
BSD license is permissive, allowing use in most projects without significant legal constraints.
Quickstart
from cachey import Cache
c = Cache(1e9, 1) # 1 GB cache, cost threshold 1
c.put('x', 'some value', cost=3)
result = c.get('x')
Requires Python 3.6 or later.
Verify before relying
- Whether the package's scoring algorithm remains suitable for modern analytic workloads.
- Real-world performance and memory overhead compared to alternatives in active maintenance.
- Compatibility with current versions of scientific libraries.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — heapdict |
| Maintenance | abandoned — 2,347 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 225,252/month — #9,225 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cachey-0.2.1-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
repoze-lruA lightweight LRU (least recently used) cache…
permissive · top 5,000 on PyPI
flexcacheCaches the results of expensive computations to…
permissive · top 5,000 on PyPI
cacheoutCacheout provides in-memory caching with…
permissive · top 5,000 on PyPI
django-memoizeCaches function and method results in Django…
permissive · top 15,000 on PyPI
memoizationDecorator-based function result caching with…
permissive · top 5,000 on PyPI
pylruProvides a pure-Python LRU (least recently…
permissive · top 15,000 on PyPI
cacheboxCachebox is a high-performance in-memory…
permissive · top 5,000 on PyPI
py-memoizeCaching library for async Python applications…
permissive · top 15,000 on PyPI
asyncacheProvides decorator-based caching for async…
permissive · top 5,000 on PyPI
boltonsBoltons provides a collection of over 230…
permissive · top 1,000 on PyPI