$npx skillfedfor your agent

pylru

A least recently used (LRU) cache implementation

Worth itPyPI Python ModulesReleased Apr 2026459.4K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pylru-1.3.1-py3-none-any.whl
v1.3.1 · released 2026-04-06 · Python >=3.3

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.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • No runtime dependencies and low install friction.
  • Marked as active maintenance with a recent release in 2026-04.
  • Requires Python 3.3 or later.

License · maintenance · safety

MIT (permissive) — MIT license permits use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

last release 2026-04-06 (130 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 459,424 downloads/mo, #6,543 on PyPI

Verify before relying

import pylru

# Create a cache with size 100
cache = pylru.lrucache(100)

# Use it like a dict
cache['key'] = 'value'
print(cache['key'])  # Lookup moves key to most-recently-used

# Or wrap a dict-like object with write-through caching
store = {}  # Any dict-like object
cached = pylru.lruwrap(store, 100)
cached['key'] = 'value'
  • Performance characteristics compared to functools.lru_cache or other caching libraries in typical workloads
  • Thread-safety guarantees or limitations when used in concurrent environments
Same gist for agents: .md · .json

What it is and 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—WriteThroughCacheManager and WriteBackCacheManager—that 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.

The 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.

Use it for

  • 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

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

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.

Install

pylru on PyPI

Before you install

No runtime dependencies and low install friction. Marked as active maintenance with a recent release in 2026-04. Requires Python 3.3 or later.

License in practice

MIT license permits use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

import pylru

# Create a cache with size 100
cache = pylru.lrucache(100)

# Use it like a dict
cache['key'] = 'value'
print(cache['key'])  # Lookup moves key to most-recently-used

# Or wrap a dict-like object with write-through caching
store = {}  # Any dict-like object
cached = pylru.lruwrap(store, 100)
cached['key'] = 'value'

Verify before relying

  • Performance characteristics compared to functools.lru_cache or other caching libraries in typical workloads
  • Thread-safety guarantees or limitations when used in concurrent environments

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.3
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 130 days since the last release
First released
Downloads459,424 / month, #6,543 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Evidence: pylru-1.3.1-py3-none-any.whl

Tags

Capabilities
lru cache pythonleast recently used cachecaching decoratordict-like cachefunction memoizationwrite-through cachewrite-back cache
Topics
cachingperformancedata-structures

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “dict-like cache”

  • pylruProvides a pure-Python LRU (least recently used) cache with…
  • lru-dictA fast C-based LRU (Least Recently Used) dict container that evicts…
  • json-ref-dictProvides a dict-like interface to JSONSchema documents that lazily…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also llist · lru-dict · repoze-lru · cachetools · boltons · cachey · shelved-cache · cachettl · backports.functools-lru-cache · vercel-cache