A collection of cache libraries in the same API interface.
Project Links
Meta
Maintainer: Pallets Ecosystem
Requires Python: >=3.11
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
Operating System
- OS Independent
Programming Language
- Python
Typing
- Typed
CacheLib
A collection of cache libraries in the same API interface. Extracted from Werkzeug.
Supported backends include:
- DynamoDbCache (DynamoDB)
- FileSystemCache (file based)
- MemcachedCache (Memcached)
- MongoDbCache (MongoDB)
- RedisCache (Redis)
- SimpleCache (in-memory, single-process)
- UWSGICache (uWSGI)
- ValkeyCache (Valkey)
Pallets Ecosystem
[!IMPORTANT]
This project is part of the Pallets Ecosystem. Pallets is the open source organization that maintains Flask; Pallets-Eco enables community maintenance of related projects. If you are interested in helping maintain this project, please reach out on the Pallets Discord server.
Installation
Install from PyPI:
pip install cachelib
A Minimal Example
from cachelib import SimpleCache
# Create a cache instance
cache = SimpleCache()
# Set a value in the cache
cache.set("my_key", "my_value")
# Retrieve the value from the cache
value = cache.get("my_key")
print(value) # Output: my_value
# Delete the value from the cache
cache.delete("my_key")
# Try to retrieve the deleted value
value = cache.get("my_key")
print(value) # Output: None
0.17.0
Aug 24, 2026
0.16.1
Aug 21, 2026
0.16.0
Aug 20, 2026
0.15.4
Aug 08, 2026
0.15.3
Aug 08, 2026
0.15.2
Aug 07, 2026
0.15.1
Aug 07, 2026
0.15.0
Jul 30, 2026
0.14.0
May 09, 2026
0.13.0
Apr 13, 2024
0.12.0
Feb 11, 2024
0.11.0
Feb 10, 2024
0.10.2
Jan 31, 2023
0.10.1
Jan 22, 2023
0.10.0
Jan 10, 2023
0.9.0
Jun 26, 2022
0.8.0
Jun 14, 2022
0.7.0
May 14, 2022
0.6.0
Jan 18, 2022
0.5.0
Dec 31, 2021
0.4.1
Oct 04, 2021
0.4.0
Oct 04, 2021
0.3.0
Aug 12, 2021
0.2.0
Jun 25, 2021
0.1.1
Jun 20, 2020
0.1
Nov 28, 2018