--- id: repoze-lru version: "0.8" license: LicenseRef-Repoze-BSD-derived license_treatment: permissive maintenance: active --- # repoze-lru — A tiny LRU cache implementation and decorator License: permissive · Maintenance: active · Downloads: 3.2M/mo ## 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 above — 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 pip install repoze-lru uv add repoze-lru poetry add repoze-lru ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 3.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags lru cache python, least recently used cache, in-memory cache eviction, cache decorator, memory-efficient caching, repoze lru, simple cache implementation, caching, performance-optimization, wsgi [View on SkillFed](https://skillfed.io/packages/repoze-lru) · [View on PyPI](https://pypi.org/project/repoze-lru/)