
Research
/Security News
CanisterWorm: npm Publisher Compromise Deploys Backdoor Across 29+ Packages
The worm-enabled campaign hit @emilgroup and @teale.io, then used an ICP canister to deliver follow-on payloads.
aiolrucache
Advanced tools
An asyncio LRU cache with TTL support for Python 3.14+.
pip install aiolrucache
@lru_cache)import asyncio
from aiolrucache import AsyncLRU
async def main():
cache = AsyncLRU(max_size=128, ttl=3600.0) # 1 hour TTL
await cache.set("key", {"data": "value"})
result = await cache.get("key")
async with AsyncLRU(max_size=64) as cache:
await cache.set("foo", "bar")
print(await cache.get("foo"))
asyncio.run(main())
from aiolrucache import alru_cache, lru_cache
# Async
@alru_cache(max_size=64, ttl=1800.0)
async def fetch_data(url: str) -> dict:
# Expensive async operation
...
# Sync
@lru_cache(max_size=128)
def expensive_computation(n: int) -> int:
...
class AsyncLRU[K, V]:
def __init__(self, max_size: int, ttl: float | None = None) -> None:
"""
Args:
max_size: Maximum number of entries (required, must be positive)
ttl: Time-to-live in seconds (optional, None = no expiry)
"""
async def get(self, key: K) -> V | None: ...
async def set(self, key: K, value: V) -> None: ...
async def clear(self) -> None: ...
async def aclose(self) -> None: ...
def __len__(self) -> int: ...
def __contains__(self, key: K) -> bool: ...
def info(self) -> dict: ...
@alru_cache(max_size: int = 128, *, ttl: float | None = None)
async def cached_func(arg: ArgType) -> ReturnType: ...
# Methods added to decorated function:
cached_func.cache_clear() # Clear the cache
cached_func.cache_info() # dict with max_size, ttl, size
Same API as @alru_cache but for sync functions.
# Install dev dependencies
uv sync --extra dev
# Run tests
pytest
# Run linter
ruff check src tests
# Run type checker
uvx ty check src
MIT
FAQs
An asyncio LRU cache with TTL support
We found that aiolrucache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The worm-enabled campaign hit @emilgroup and @teale.io, then used an ICP canister to deliver follow-on payloads.

Research
/Security News
Attackers compromised Trivy GitHub Actions by force-updating tags to deliver malware, exposing CI/CD secrets across affected pipelines.

Security News
ENISA’s new package manager advisory outlines the dependency security practices companies will need to demonstrate as the EU’s Cyber Resilience Act begins enforcing software supply chain requirements.