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.4.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cachr-0.0.4.tar.gz.

File metadata

  • Download URL: cachr-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 7ef7d93bfc90441c7d03c82e14b55231213d2eca95b0f7a15ed154c92718e3aa
MD5 7352d8636f9e35772bb400051b9e0625
BLAKE2b-256 b80d0f22a02cc7b1b17914d5e589550f82f2862c0d14ec0e63e22d7a7ca2cd49

See more details on using hashes here.

File details

Details for the file cachr-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: cachr-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ac5b45daa5fa5c4a144d51a7e42e0631a3cd83fde548a62b320b3c2a8af82e7b
MD5 46b0f459ec25c2cf237ff97879cad9dd
BLAKE2b-256 bdcf148259b59c8decb27e4bd498311a12426e83eb8644ff790d07d8954b3d85

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