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.3.tar.gz
.
File metadata
- Download URL: cachr-0.0.3.tar.gz
- Upload date:
- Size: 6.7 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 | db6d7cd890481fe91d53109d3963fd6b981974e112727e33f5085d5096cb3255 |
|
MD5 | c1f6e143c4cb3c881ed08d00970409e4 |
|
BLAKE2b-256 | 222c46447abe1f56130ce3f304ae190a2c01e9ca9a03891351d2cb26c1d3b313 |
File details
Details for the file cachr-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: cachr-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.9 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 | 8182d9a319aced18cede6f2e235d064a508b900f77ac20b7f179d4aa2e5f5742 |
|
MD5 | 805940da0ca66d6379a7ce35b13cdff7 |
|
BLAKE2b-256 | f31a42861745cca3fad363f101edecd0facbfae85c8ebb7e2f65cbc6e2536c45 |