repoze-lru
A tiny LRU cache implementation and decorator
What it is and what it does
repoze.lru is a standalone LRU cache implementation designed to automatically manage memory by evicting the least recently used entries when the cache reaches its size limit. It provides both a decorator and a direct cache class interface, making it suitable for caching expensive function results or storing frequently accessed data.
The package has been maintained since 2009 and is classified as mature. It carries no runtime dependencies, making it lightweight and easy to integrate into existing projects. The implementation supports modern Python versions and is actively maintained, with recent updates confirming ongoing compatibility.
Use it for:
- Decorate expensive database query functions to avoid repeated lookups with the same parameters.
- Cache API responses in web applications to reduce external service calls.
- Store computed results in data processing pipelines to speed up repeated calculations.
- Implement session or token caching in WSGI middleware applications.
- Reduce memory usage in long-running processes by automatically evicting stale cached data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A lightweight LRU (least recently used) cache implementation that evicts infrequently accessed keys and values to manage memory automatically.
Yes. This is a mature, dependency-free caching utility with active maintenance, permissive licensing, and no known vulnerabilities. Install it if you need a simple, lightweight LRU cache without the overhead of external dependencies or more complex caching frameworks. It is particularly suited to WSGI and web applications.
Install
repoze-lru on PyPI
pip
pip install repoze-lruuv
uv add repoze-lrupoetry
poetry add repoze-lruInstalling repoze-lru
Before you install
Low friction install with no runtime dependencies. Actively maintained, last release within 90 days, repository not archived, and supports current Python versions.
License in practice
Licensed under a permissive Repoze BSD-derived license, allowing use in most projects without significant legal constraints.
Quickstart
pip install repoze-lru
from repoze.lru import lru_cache
@lru_cache()
def cached_function(x):
return x * 2
Requires Python 3.10 or later.
Verify before relying
- Whether the cache is thread-safe for concurrent access patterns.
- Performance characteristics compared to standard library alternatives.
- Memory overhead per cached entry and eviction behavior under load.
- Specific maxsize parameter defaults and tuning guidance.
Package facts
| License | LicenseRef-Repoze-BSD-derived (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 90 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,200,599/month — #2,705 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: repoze_lru-0.8-py3-none-any.whl
Keywords: repoze, lru, cache
Tags
More WWW/HTTP 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
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
cacheyCachey provides intelligent caching for…
permissive · top 15,000 on PyPI
lru-dictA fast C-based LRU (Least Recently Used) dict…
permissive · top 5,000 on PyPI
pylruProvides a pure-Python LRU (least recently…
permissive · top 15,000 on PyPI
repoze.whorepoze.who is an identification and…
permissive · top 15,000 on PyPI
repoze-sendmailCouples email sending with Zope transactions,…
permissive · top 15,000 on PyPI
backports.functools-lru-cacheProvides the lru_cache decorator from Python…
permissive · top 5,000 on PyPI
theineTheine is a high-performance in-memory cache…
permissive · top 15,000 on PyPI
cacheoutCacheout provides in-memory caching with…
permissive · top 5,000 on PyPI
cachetoolsProvides memoizing collections and function…
permissive · top 1,000 on PyPI
onecacheOneCache provides LRU-based caching decorators…
permissive · top 15,000 on PyPI