skillfed

async-lru

Simple LRU cache for asyncio

async-lru Permissive license MIT License Active 951 v2.3.0 released

Install

async-lru on PyPI

pip

pip install async-lru

uv

uv add async-lru

poetry

poetry add async-lru

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing_extensions
Maintenance actively maintained — 147 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

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

Keywords: asyncio, lru, lru_cache

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

About async-lru

from the package's own PyPI description — quoted content, verbatim

async-lru

:info: Simple lru cache for asyncio

.. image:: https://github.com/aio-libs/async-lru/actions/workflows/ci-cd.yml/badge.svg?event=push :target: https://github.com/aio-libs/async-lru/actions/workflows/ci-cd.yml?query=event:push :alt: GitHub Actions CI/CD workflows status

.. image:: https://img.shields.io/pypi/v/async-lru.svg?logo=Python&logoColor=white :target: https://pypi.org/project/async-lru :alt: async-lru @ PyPI

.. image:: https://codecov.io/gh/aio-libs/async-lru/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/async-lru

.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat :target: https://matrix.to/#/%23aio-libs:matrix.org :alt: Matrix Room — #aio-libs:matrix.org

.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat :target: https://matrix.to/#/%23aio-libs-space:matrix.org :alt: Matrix Space — #aio-libs-space:matrix.org

Installation

.. code-block::...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Provides an LRU cache decorator for async functions that deduplicates concurrent calls and supports TTL expiration with jitter, mirroring Python's functools.lru_cache for asyncio.

Minimal friction: pure-Python wheel with only typing_extensions as a runtime dependency. Active maintenance with recent releases (147 days since last) and 951 GitHub stars signal a stable, well-maintained library.

MIT License (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Usage

pip install async-lru

from async_lru import alru_cache

@alru_cache(maxsize=32)
async def my_func(arg):
    return arg * 2

await my_func(5)  # Returns 10
print(my_func.cache_info())  # View hit/miss stats

Requires Python ≥3.10. Cache instances are bound to a single event loop; using the same decorated function across multiple event loops raises RuntimeError.

Verdict: Production-ready async caching library with low install friction, active maintenance, and no known vulnerabilities. The single-event-loop constraint is documented and manageable for typical asyncio applications. Recommended for projects needing efficient memoization of async functions with optional TTL support.

Needs verification

  • Performance characteristics relative to alternatives or uncached baselines in real-world async workloads
  • Whether the thundering herd mitigation (jitter) is effective in high-concurrency scenarios
async lru cache decoratorasyncio function memoizationconcurrent call deduplicationttl cache asyncioasync function cachinglru_cache for asynciocache expiration jitter

Similar packages