cacheout
A caching library for Python
What it is and what it does
Cacheout is a pure-Python in-memory caching library that stores key-value pairs with configurable eviction policies and optional time-based expiration. It offers six eviction strategies (FIFO, LIFO, LRU, MRU, LFU, RR) and supports TTL per entry or globally, with a maximum cache size enforced by the chosen policy. The library is thread-safe and provides bulk operations, filtering by string/regex/function, and event callbacks for cache lifecycle events.
It is typically used to reduce computation or I/O by caching function results via the memoization decorator, managing multiple independent caches through CacheManager, or as a simple session or data store within a single process. The package has no external runtime dependencies, making it lightweight to add to existing projects. Maintenance is dormant but the codebase is stable; the last release added callback hooks and statistics tracking.
Use it for:
- Memoize expensive function calls to avoid recomputation within a single process or application session
- Implement a simple session store or temporary data cache with automatic expiration via TTL
- Manage multiple independent caches (e.g., for different data types or modules) using CacheManager
- Cache API responses or database query results with LRU eviction to bound memory usage
- Track cache hit/miss statistics and performance metrics using built-in stats tracking
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cacheout provides in-memory caching with multiple eviction strategies (FIFO, LIFO, LRU, MRU, LFU, RR), TTL support, memoization decorators, and thread safety for Python applications.
Yes, if you need a lightweight, dependency-free in-memory cache with multiple eviction strategies and TTL support for a single-process application. The dormant maintenance status (last release 900+ days ago) is acceptable for a stable caching library with no active security vulnerabilities, but monitor the repository if you require ongoing feature development or rapid bug fixes. Not suitable if you need distributed caching or Redis-like persistence.
Install
cacheout on PyPI
pip
pip install cacheoutuv
uv add cacheoutpoetry
poetry add cacheoutInstalling cacheout
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-12-22, over 900 days ago—but the repository remains active and the package supports current Python versions (3.7–3.12).
License in practice
MIT License (permissive) allows commercial and private use with minimal restrictions; you may use, modify, and distribute freely provided you include the license notice.
Quickstart
pip install cacheout
from cacheout import Cache
cache = Cache(maxsize=256, ttl=0)
cache.set('key', 'value')
assert cache.get('key') == 'value'
Requires Python >= 3.7
Verify before relying
- Performance characteristics (throughput, latency) compared to alternatives under typical workloads
- Thread-safety guarantees under high concurrency or with custom eviction strategies
- Memory overhead per cached entry relative to raw dictionary storage
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 966 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 896,353/month — #4,787 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cacheout-0.16.0-py3-none-any.whl
Keywords: cacheout, cache, caching, memoize, memoization, fifo, lifo, lfu, lru, mru
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
cacheboxCachebox is a high-performance in-memory…
permissive · top 5,000 on PyPI
memoizationDecorator-based function result caching with…
permissive · top 5,000 on PyPI
theineTheine is a high-performance in-memory cache…
permissive · top 15,000 on PyPI
onecacheOneCache provides LRU-based caching decorators…
permissive · top 15,000 on PyPI
cacheyCachey provides intelligent caching for…
permissive · top 15,000 on PyPI
cachetoolsProvides memoizing collections and function…
permissive · top 1,000 on PyPI
py-memoizeCaching library for async Python applications…
permissive · top 15,000 on PyPI
lru-dictA fast C-based LRU (Least Recently Used) dict…
permissive · top 5,000 on PyPI
async-cacheIn-memory async cache for Python applications…
permissive · top 15,000 on PyPI
asyncacheProvides decorator-based caching for async…
permissive · top 5,000 on PyPI