cashews
cache tools with async power
Decision gist · record as of 2026-08-14
Yes. Cashews is production-ready (stable classifier, active maintenance, no known vulnerabilities), has low install friction, and offers a clean async API with flexible backends. Choose it if you need decorator-based caching in async code and want to avoid vendor lock-in to a single backend. The optional extras (Redis, DiskCache) let you start simple and scale later.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Optional backends (Redis, DiskCache, dill, xxhash) require separate package installation.
- Low friction: pure Python wheel with no runtime dependencies.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) allows commercial and private use with minimal restrictions.
last release 2026-03-02 (165 days) · last repo commit 2026-03-02 · 590 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 755,176 downloads/mo, #5,141 on PyPI
Alternatives
Verify before relying
pip install cashews
from cashews import cache
await cache.setup("mem://")
@cache(ttl="3h", key="user:{request.user.uid}")
async def long_running_function(request):
return result- Performance claim ('2x faster than aiocache') lacks benchmark details or methodology.
- Actual memory footprint and scalability limits for in-memory backend with large datasets.
- Transactionality semantics and guarantees across different backends.
What it is and what it does
Cashews is an async-first caching library that wraps multiple storage backends (in-memory, Redis, DiskCache) under a unified decorator and function-call API. It lets you cache async function results with configurable TTL, custom key templates, and cache invalidation strategies—useful for reducing load on slow operations or external services in async applications.
The library emphasizes ease of use through decorators and supports advanced techniques like client-side caching (claimed to be faster than simple Redis caching), bloom filters, compression, and transactional modes. You can mix backends by prefix, serialize complex objects with pickle or dill, and monitor cache hits/misses. It has no required runtime dependencies, making installation lightweight; optional extras unlock Redis, DiskCache, and serialization features.
Use it for
- Decorate long-running async functions to cache results with automatic TTL expiry and key templating.
- Set up multi-tier caching (in-memory + Redis) by prefix to balance speed and shared state.
- Cache database query results or API responses in async web frameworks like FastAPI.
- Implement cache invalidation by tags or time-based strategies to keep stale data out.
- Use client-side caching with Redis to reduce round-trips and improve latency in high-throughput services.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Cashews is production-ready (stable classifier, active maintenance, no known vulnerabilities), has low install friction, and offers a clean async API with flexible backends. Choose it if you need decorator-based caching in async code and want to avoid vendor lock-in to a single backend. The optional extras (Redis, DiskCache) let you start simple and scale later.
Install
cashews on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with recent release (165 days ago) and 590 repository stars. Supports Python 3.10–3.14.
Requires Python 3.10 or later. Optional backends (Redis, DiskCache, dill, xxhash) require separate package installation.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions.
Quickstart
pip install cashews
from cashews import cache
await cache.setup("mem://")
@cache(ttl="3h", key="user:{request.user.uid}")
async def long_running_function(request):
return result
Verify before relying
- Performance claim ('2x faster than aiocache') lacks benchmark details or methodology.
- Actual memory footprint and scalability limits for in-memory backend with large datasets.
- Transactionality semantics and guarantees across different backends.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 165 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 755,176 / month, #5,141 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming 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: cashews-7.5.0-py3-none-any.whl
Tags
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 cache framework”
- cashewsAsync cache framework with decorator and direct API support for…
- py-key-value-aioProvides an async-only, pluggable key-value store abstraction with…
- py-memoizeCaching library for async Python applications that prevents cache…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also aiocache · python-redis-cache · async-cache · fastapi-cache2 · cachelib · django-redis · flexcache · diskcache-weave · diskcache-stubs · diskcache