skillfed

cacheout

A caching library for Python

cacheout v0.16.0 896.4K downloads/30d#4,787 on PyPI435
Permissive license MIT License DORMANT released

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 cacheout

uv

uv add cacheout

poetry

poetry add cacheout

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: DatabaseTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

in-memory cache librarypython caching with TTLmemoization decoratorLRU cache implementationcache eviction strategiesthread-safe cachecache manager multiple caches
in-memory-cachememoizationeviction-policies

More Libraries packages