{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/11"}],"enrichment":{"capability":"Provides a pure-Python LRU (least recently used) cache with constant-time lookup, insert, and delete operations, plus wrapper classes for caching access to dict-like objects and functions.","skillfed_tags":["caching","performance","data-structures"],"use_cases":["Cache expensive function results or API calls to reduce latency and improve response times","Wrap a slow backend storage or database with write-through caching to speed up repeated reads","Implement write-back caching for batch updates, deferring writes to the store until cache eviction","Build a bounded in-memory cache for web application session data or computed results","Use as a decorator or wrapper to memoize function outputs with a fixed memory footprint"],"what_it_does":"Pylru is a pure-Python LRU cache implementation that maintains a fixed-size collection of key-value pairs, automatically evicting the least recently used item when capacity is reached. It provides a dictionary-like interface for direct caching, plus two wrapper classes\u2014WriteThroughCacheManager and WriteBackCacheManager\u2014that compose an LRU cache with any dict-like object (such as a remote store or database) to transparently cache reads and writes. Write-through updates the underlying store immediately; write-back defers store updates until eviction or explicit sync.\n\nThe package is written in pure Python with no external dependencies, making it lightweight and portable. All core operations (lookup, insert, delete) run in constant time. It supports optional callbacks on eviction, iteration over keys/values in LRU order, and resizing the cache at runtime. The cache is scan-resistant when using iteration methods, and both the cache and wrapper classes can be used as context managers.","worth_installing":"Yes. Pylru is a stable, dependency-free LRU cache with a clean API and no known vulnerabilities. Install it if you need a simple, pure-Python caching layer with constant-time operations and optional write-through or write-back semantics for dict-like backends. Skip it if you only need basic function memoization (functools.lru_cache is built-in) or if you require thread-safety guarantees."},"id":"pylru","links":{"html":"https://skillfed.io/packages/pylru","md":"https://skillfed.io/packages/pylru.md","pypi":"https://pypi.org/project/pylru/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-06","license_spdx":"MIT","license_treatment":"permissive","name":"pylru","python_support":"supports_current","summary":"A least recently used (LRU) cache implementation"},"popularity":{"monthly_downloads":459424,"position":6543,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.3.1"}
