$npx skillfedfor your agent

async-lru

Simple LRU cache for asyncio

Worth itPyPI Released Mar 202648.2M downloads / moMIT LicensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — async_lru-2.3.0-py3-none-any.whl
v2.3.0 · released 2026-03-19 · Python >=3.10 · 1 runtime deps: typing_extensions

Yes. Production-stable, actively maintained, zero vulnerabilities, and low install friction. Use it whenever you need to cache async function results with deduplication of concurrent calls—a common pattern in async I/O applications. The single-loop affinity constraint is straightforward to work around in multi-loop scenarios.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Cache instance is bound to a single event loop; using it across different loops raises RuntimeError.
  • Low friction: pure Python wheel with a single lightweight runtime dependency (typing_extensions).

License · maintenance · safety

MIT License (permissive) — MIT License permits commercial and private use with minimal restrictions—suitable for most projects.

last release 2026-03-19 (148 days) · last repo commit 2026-08-10 · 951 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 48,158,538 downloads/mo, #596 on PyPI

Verify before relying

pip install async-lru

from async_lru import alru_cache

@alru_cache(maxsize=32)
async def get_data(key):
    return key * 2

await get_data(5)  # Returns 10
get_data.cache_info()  # View hit/miss counts
  • Performance characteristics compared to alternatives or uncached async functions
  • Memory overhead of the cache structure relative to maxsize
  • Behavior when concurrent calls exceed available system resources
Same gist for agents: .md · .json

What it is and what it does

async-lru is a port of Python's built-in functools.lru_cache for asyncio functions. It caches the results of async function calls and automatically deduplicates concurrent invocations—when multiple coroutines await the same uncached arguments simultaneously, only one actual function call executes, and all awaiters receive the same result. This prevents redundant work and thundering-herd problems in high-concurrency scenarios.

The decorator supports LRU eviction (bounded cache), TTL expiration with optional jitter to spread invalidations, explicit cache invalidation by arguments, and introspection methods (cache_info, cache_contains). It enforces single-loop affinity: a cache instance must be used with only one event loop, though separate instances can be created per loop in multi-loop applications.

Use it for

  • Cache HTTP responses in async web scrapers or API clients to avoid redundant network calls
  • Deduplicate database queries when multiple concurrent requests ask for the same data
  • Memoize expensive async computations with TTL to balance freshness and performance
  • Prevent thundering-herd cache stampedes by ensuring only one refresh call per expired key
  • Speed up async test fixtures by caching setup results across test runs

Worth the install?

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

Worth it

Yes.

Production-stable, actively maintained, zero vulnerabilities, and low install friction. Use it whenever you need to cache async function results with deduplication of concurrent calls—a common pattern in async I/O applications. The single-loop affinity constraint is straightforward to work around in multi-loop scenarios.

Install

async-lru on PyPI

Before you install

Low friction: pure Python wheel with a single lightweight runtime dependency (typing_extensions). Active maintenance with recent releases and no known vulnerabilities.

Requires Python 3.10 or later. Cache instance is bound to a single event loop; using it across different loops raises RuntimeError.

License in practice

MIT License permits commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install async-lru

from async_lru import alru_cache

@alru_cache(maxsize=32)
async def get_data(key):
    return key * 2

await get_data(5)  # Returns 10
get_data.cache_info()  # View hit/miss counts

Verify before relying

  • Performance characteristics compared to alternatives or uncached async functions
  • Memory overhead of the cache structure relative to maxsize
  • Behavior when concurrent calls exceed available system resources

Package facts

LicenseMIT License permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
typing_extensions
MaintenanceActively maintained 148 days since the last release
Last repo commit
First released
Downloads48,158,538 / month, #596 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Evidence: async_lru-2.3.0-py3-none-any.whl

Tags

Capabilities
async lru cache decoratorasyncio function memoizationconcurrent call deduplicationttl cache for asyncfunctools.lru_cache for asyncioasync cache with expirationdistributed cache invalidation
Topics
asynciocachingperformance
PyPI keywords
asynciolrulru_cache

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 › “async lru cache decorator”

  • async-lruAn LRU cache decorator for async functions that deduplicates…
  • cachetools-asyncProvides async-aware memoization decorators for Python asyncio…
  • cachettlcachettl provides LRU TTL cache decorators for both synchronous and…

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

Similar packages

async-cache Worth it
PyPI · Application Frameworks · released Apr 2026

In-memory async cache for Python applications with TTL, LRU eviction, thundering herd protection, and DataLoader-style batching to reduce redundant work under concurrent load.

permissive licensepure Python · 3.3+
218.1Kdownloads / mo
cachettl With conditions
PyPI · Libraries · released Jul 2024

cachettl provides LRU TTL cache decorators for both synchronous and asynchronous functions, with configurable size limits, type-aware caching, and cache statistics tracking.

However, maintenance is dormant (last commit July 2024, no updates since), so adopt it only if you accept that bug fixes or feature requests may not be addressed.

MITbuilds from source · 3.7+dormant
74.4Kdownloads / mo
onecache Worth it
PyPI · Software Development · released Feb 2026

OneCache provides LRU-based caching decorators for both synchronous and asynchronous Python functions, with optional per-entry TTL expiration and configurable memory limits.

Install it if you need simple LRU caching with optional TTL and don't want to manage an external cache service.

MITpure Python · 3.8+
725.7Kdownloads / mo
pytest-antilru Worth it
PyPI · Testing · released May 2026

Clears functools.lru_cache between pytest test runs to prevent test pollution from cached values persisting across tests.

MITpure Python · 3.9+
239.8Kdownloads / mo
memoization Skip
PyPI · Libraries · released Aug 2021

Decorator-based function result caching with configurable TTL, multiple eviction algorithms (LRU, LFU, FIFO), and support for unhashable arguments.

MITbuilds from sourceabandoned
1.3Mdownloads / mo
cachetools-async Worth it
PyPI · Software Development · released Jun 2025

Provides async-aware memoization decorators for Python asyncio coroutines, extending cachetools with support for caching async function results using LRU, TTL, and other fixed-size cache strategies.

Install it if you need memoization for asyncio functions and want to reuse cachetools' familiar cache strategies.

MITpure Python · 3.9+
512.7Kdownloads / mo

See also backports.functools-lru-cache · asyncache · cacheout · functools32