--- id: cachebox version: "6.2.5" license: MIT license_treatment: permissive maintenance: active --- # cachebox — The fastest memoizing and caching Python library written in Rust License: permissive · Maintenance: active · Downloads: 14.6M/mo ## What it is and what it does Cachebox is a Rust-based caching library that accelerates Python applications by storing computed results in memory and reusing them on subsequent calls with identical arguments. It provides seven cache algorithms (FIFO, LRU, and others) and can be used either as a decorator for functions or as a standalone dictionary-like cache object. The library is designed to be thread-safe, have minimal memory overhead, and avoid cache stampede through distributed locking. You would use cachebox when your application repeatedly accesses the same data or performs expensive computations, database queries, or API calls. It copies mutable objects (dict, list, set) by default, preventing accidental mutations from affecting cached results—a behavior that distinguishes it from Python's built-in functools.lru_cache. The package has zero Python dependencies and supports both synchronous and asynchronous functions. Use it for: - Memoizing expensive mathematical or data-processing functions to avoid redundant computation. - Caching database query results to reduce load and latency in web applications. - Storing API responses to minimize external requests and manage rate-limit quotas. - Accelerating machine learning inference by caching predictions for repeated input data. - Reducing rendering time in web frameworks by caching generated HTML or template results. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Cachebox is a high-performance in-memory caching library written in Rust that provides multiple cache algorithms (FIFO, LRU, and others) for memoizing function results and storing arbitrary data with minimal overhead. Yes. Cachebox is actively maintained, has no known vulnerabilities, supports current Python versions, and offers a permissive MIT license. The compiled-wheel distribution is straightforward on common platforms. Install it if you need fast, thread-safe caching with multiple eviction policies and minimal setup overhead—particularly valuable in high-traffic or compute-intensive applications. ## Install pip install cachebox uv add cachebox poetry add cachebox ## Installing cachebox Before you install: Medium install friction due to compiled wheels, but pre-built binaries are available for common platforms (macOS, Linux, Windows) and Python 3.10+. The package is actively maintained with a recent release (4 days old) and no known vulnerabilities. License in practice: MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install cachebox import cachebox @cachebox.cached(cachebox.LRUCache(maxsize=128)) def expensive_function(x): return x ** 2 result = expensive_function(5) Requires Python 3.10 or later; PyPy and CPython both supported. Verify before relying: - Whether the claimed 10-50x performance improvement over other caching libraries holds for your specific use case and cache size. - Thread-safety guarantees under high concurrency loads in production environments. - Behavior of cache eviction policies under memory pressure or with very large datasets. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 14.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fast python caching library, memoization decorator, in-memory cache, lru cache alternative, rust-based caching, performance, memoization, rust-extension [View on SkillFed](https://skillfed.io/packages/cachebox) · [View on PyPI](https://pypi.org/project/cachebox/)