Skip to main content

Library that allows you to compose your own cache, pre-packaged with many useful caches

Project description

██████╗ █████╗  ██████╗██╗  ██╗██████╗   
██╔════╝██╔══██╗██╔════╝██║  ██║██╔══██╗  
██║     ███████║██║     ███████║██████╔╝  
██║     ██╔══██║██║     ██╔══██║██╔══██╗  
╚██████╗██║  ██║╚██████╗██║  ██║██║  ██║  
╚═════╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝  

cachr: superfast, composable caching for Python

Package PyPI Latest Release PyPI Downloads
Meta GitHub License

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

  • 🐍 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

MIT

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!


Go to Top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cachr-0.0.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

cachr-0.0.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

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

Hashes for cachr-0.0.3.tar.gz
Algorithm Hash digest
SHA256 db6d7cd890481fe91d53109d3963fd6b981974e112727e33f5085d5096cb3255
MD5 c1f6e143c4cb3c881ed08d00970409e4
BLAKE2b-256 222c46447abe1f56130ce3f304ae190a2c01e9ca9a03891351d2cb26c1d3b313

See more details on using hashes here.

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

Hashes for cachr-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8182d9a319aced18cede6f2e235d064a508b900f77ac20b7f179d4aa2e5f5742
MD5 805940da0ca66d6379a7ce35b13cdff7
BLAKE2b-256 f31a42861745cca3fad363f101edecd0facbfae85c8ebb7e2f65cbc6e2536c45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page