skillfed

aiocache

multi backend asyncio cache

aiocache v0.12.3 8.8M downloads/30d#1,587 on PyPI1,437
License unclear Active released

What it is and what it does

aiocache is an asyncio caching library that abstracts over multiple backend storage systems—in-memory, Redis, and memcached—behind a single, consistent API. It lets you cache the results of async functions and manage key-value data without rewriting code when you switch backends. The library includes decorators for transparent caching, serializers to handle Python objects, and a plugin system for hooks like timing and hit-miss tracking.

You can use it as a simple in-process cache for development, swap to Redis or memcached for production, and configure everything through a unified interface. It has no runtime dependencies by default; optional backends require their respective client libraries installed separately.

Use it for:

  • Cache results of expensive async database queries in a web framework.
  • Store serialized Python objects in Redis for sharing cached state across multiple processes.
  • Decorate async functions with @cached to automatically memoize results with configurable TTL and namespacing.
  • Switch from in-memory caching during development to memcached in production without changing application code.
  • Implement multi-key operations (multi_get, multi_set) to batch cache reads and writes efficiently.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides asyncio-compatible caching with pluggable backends (memory, Redis, memcached) and a uniform interface for get, set, delete, and other standard cache operations.

Yes. aiocache is actively maintained, has no install friction, and provides a clean abstraction over multiple cache backends—valuable for async Python applications that may need to scale from development to production. The main caveat is the unclear license status; verify the actual license before committing to production use. No known vulnerabilities.

Install

aiocache on PyPI

pip

pip install aiocache

uv

uv add aiocache

poetry

poetry add aiocache

Installing aiocache

Before you install

Low install friction with no runtime dependencies. Actively maintained with recent commits and 1437 repository stars. Supports Python 3.7 through 3.11.

License in practice

License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before using in proprietary or restricted contexts.

Quickstart

import asyncio
from aiocache import Cache

async def example():
    cache = Cache(Cache.MEMORY)
    await cache.set('key', 'value')
    result = await cache.get('key')
    print(result)  # 'value'

asyncio.run(example())

Optional backends (Redis, memcached) need separate installation via pip install aiocache[redis] or aiocache[memcached].

Verify before relying

  • Whether the package is licensed under an open-source or proprietary license (metadata shows no license declaration).
  • Performance characteristics and typical throughput for each backend type.
  • Whether serializers (PickleSerializer, JsonSerializer, MsgPackSerializer) are included by default or require extra dependencies.
  • Minimum Python version requirement (classifiers list 3.7 through 3.11 but requires_python is unspecified).

Package facts

License not declared (unclear)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 688 days since the last release
Last repo commit
First released
Downloads 8,847,386/month — #1,587 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiocache-0.12.3-py2.py3-none-any.whl

Framework :: AsyncIOProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

asyncio cache libraryredis memcached wrapperasync caching backendspython async cachemulti-backend cacheaiocache decoratorasync cache abstraction
asynciocachingredis-memcached

More Database packages