██████╗ █████╗ ██████╗██╗ ██╗██████╗
██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗
██║ ███████║██║ ███████║██████╔╝
██║ ██╔══██║██║ ██╔══██║██╔══██╗
╚██████╗██║ ██║╚██████╗██║ ██║██║ ██║
╚═════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝
Package | |
Meta |
cachr is a Python package that provides superfast, composable caches designed to optimize your applications in an easy and intuitive way. It aims to be the go-to package to use and build caches that make your applications superfast, memory-efficient and user-friendly.
pip install cachr
- Main Features
- Usage Example
- Installation
- Dependencies
- License
- Documentation
- Development
- Contributing to bloomlib
- 🐍 Pure Python
- 🖌 Easily extendable
- 👨🎨 User-friendly
import time
from cachr import LRUCache
# 1. Decorate your function
@LRUCache(capacity=2)
def add(i, y):
time.sleep(1)
print("adding..")
return i + y
print(add(1, 2)) # <-- takes a second to calculate
print(add(1, 2)) # <-- takes value from cache immediately
print(add(1, 2)) # <-- takes value from cache immediately
pip install cachr
The source code is currently hosted on GitHub at: https://github.com/mike-huls/cachr
Binary installers for the latest released version are available at the Python Package Index (PyPI).
Bloomlib has no Python dependencies
🔨 Under construction
Find the changelog and list of upcoming features here.
Contributions are always welcome; feel free to submit bug reports, bug fixes, feature requests, documentation improvements or enhancements!