A python library for asyncio caches (like functools cache and lru_cache)
Install the last released version using pip
:
python3 -m pip install --user -U asyncio-cache
Or install the latest version from sources:
git clone git@github.com:matan1008/asyncio-cache.git
cd asyncio-cache
python3 -m pip install --user -U -e .
The usage is similar to functools.cache
and functools.lru_cache
usage:
from asyncio_cache import cache
@cache
async def cached_read(reader):
return await reader.read(100)