cachelib
A collection of cache libraries in the same API interface.
Decision gist · record as of 2026-08-14
Yes. CacheLib is actively maintained, has no security vulnerabilities, zero runtime dependencies, and low install friction. It solves a real problem—cache backend abstraction—and is part of the trusted Pallets Ecosystem. Install it if you need flexible caching or plan to support multiple backends.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Python 3.11 or later required.
- Backend-specific clients (redis, pymongo, etc.) must be installed separately if using non-local backends.
- Low friction: pure Python wheel with no runtime dependencies.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice.
last release 2026-08-08 (6 days) · last repo commit 2026-08-12 · 161 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 19,272,987 downloads/mo, #1,070 on PyPI
Alternatives
Verify before relying
pip install cachelib
from cachelib import SimpleCache
cache = SimpleCache()
cache.set("key", "value")
print(cache.get("key")) # Output: value- Whether backend clients (redis, pymongo, etc.) are optional or required for specific cache types to function.
- Performance characteristics and memory overhead of SimpleCache vs. external backends under load.
- Whether type hints cover all public methods and backend-specific parameters.
What it is and what it does
CacheLib is a cache abstraction library that presents a single, consistent API for seven different cache backends. Instead of writing code tied to Redis or Memcached directly, you instantiate a cache object (RedisCache, MemcachedCache, SimpleCache, etc.) and use the same get/set/delete methods regardless of the backend. It was extracted from Werkzeug and is maintained by the Pallets Ecosystem.
The library supports both local caching (SimpleCache for single-process in-memory, FileSystemCache for disk) and distributed backends (Redis, Memcached, MongoDB, DynamoDB, Valkey, uWSGI). This makes it useful for applications that need to switch cache strategies without refactoring—for example, using SimpleCache in development and RedisCache in production.
Use it for
- Swap cache backends in a Flask or web application without changing application logic.
- Implement a local development cache (SimpleCache) that scales to Redis in production.
- Cache expensive database queries or API responses using a consistent interface.
- Store session data or temporary state across multiple processes using a shared backend.
- Reduce coupling between application code and a specific caching technology.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
CacheLib is actively maintained, has no security vulnerabilities, zero runtime dependencies, and low install friction. It solves a real problem—cache backend abstraction—and is part of the trusted Pallets Ecosystem. Install it if you need flexible caching or plan to support multiple backends.
Install
cachelib on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained—last commit 2026-08-12, released 2026-08-08, part of the Pallets Ecosystem.
Python 3.11 or later required. Backend-specific clients (redis, pymongo, etc.) must be installed separately if using non-local backends.
License in practice
BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice.
Quickstart
pip install cachelib
from cachelib import SimpleCache
cache = SimpleCache()
cache.set("key", "value")
print(cache.get("key")) # Output: value
Verify before relying
- Whether backend clients (redis, pymongo, etc.) are optional or required for specific cache types to function.
- Performance characteristics and memory overhead of SimpleCache vs. external backends under load.
- Whether type hints cover all public methods and backend-specific parameters.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 19,272,987 / month, #1,070 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/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonTyping :: Typed |
Evidence: cachelib-0.15.4-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 › “cache abstraction layer”
- cachelibCacheLib provides a unified API for interacting with multiple cache…
- py-key-value-aioProvides an async-only, pluggable key-value store abstraction with…
- oslo.cacheoslo.cache wraps dogpile.cache to provide a standardized caching…
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 · fastapi-cache2 · cashews · Flask-Caching · python-memcached · pylibmc · aiohttp-client-cache · simplekv · Beaker · django-valkey