Library that allows you to compose your own cache, pre-packaged with many useful caches
Project description
██████╗ █████╗ ██████╗██╗ ██╗██████╗
██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗
██║ ███████║██║ ███████║██████╔╝
██║ ██╔══██║██║ ██╔══██║██╔══██╗
╚██████╗██║ ██║╚██████╗██║ ██║██║ ██║
╚═════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝
cachr: superfast, composable caching for Python
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
Table of Contents
- Main Features
- Usage Example
- Installation
- Dependencies
- License
- Documentation
- Development
- Contributing to bloomlib
Main Features
- 🐍 Pure Python
- 🖌 Easily extendable
- 👨🎨 User-friendly
Usage Example
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
Installation
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).
Dependencies
Bloomlib has no Python dependencies
License
Documentation
🔨 Under construction
Development
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cachr-0.0.5.tar.gz
.
File metadata
- Download URL: cachr-0.0.5.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d66b45b7786025fcba49dd5fdacd09239f2c37cd8945c80ada7552093bfc2b86 |
|
MD5 | 7e8c63296e0d9ec9fa81f299e424d8f8 |
|
BLAKE2b-256 | d5633e07c4722e41986fe27dc4b44b2a8ff961a4f54669e083baf3ac62d0331d |
File details
Details for the file cachr-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: cachr-0.0.5-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd7019f5358b5f7fc1961da27eac10c714fd9406391bd172b22843fc8c501e5 |
|
MD5 | 61182011cd181a08800566412d52a87b |
|
BLAKE2b-256 | b699e2bcace48c3c358e17f97aaba505c4682944ce46d32cbc825e1317120a43 |