Skip to main content

The Python Cache Toolkit.

Project description

Cache Alchemy

https://img.shields.io/pypi/v/cache_alchemy.svg https://img.shields.io/travis/GuangTianLi/cache_alchemy.svg Documentation Status https://img.shields.io/pypi/pyversions/cache_alchemy.svg https://codecov.io/gh/GuangTianLi/cache_alchemy/branch/master/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

The Python Cache Toolkit.

Installation

$ pipenv install cache-alchemy
✨🍰✨

Only Python 3.6+ is supported.

Example

from cache_alchemy import memory_cache, redis_cache
from cache_alchemy.config import DefaultConfig
from redis import StrictRedis

config = DefaultConfig()
config.client = StrictRedis.from_url(config.CACHE_ALCHEMY_REDIS_URL)

@memory_cache
def add(i: complex, j: complex) -> complex:
    return i + j

@redis_cache
def add(i: int, j: int) -> int:
    return i + j

Features

  • Cache Json Serializable function return value with Distributed Redis Cache
  • Cache any function return value with Distributed Memory Cache
  • LRU Dict support - behave like normal dict

TODO

History

0.1.0 (2019-09-11)

  • Support cache as a decorator with no arguments.
  • Init Project.

Project details


Download files

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

Files for cache-alchemy, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size cache_alchemy-0.1.2-py2.py3-none-any.whl (10.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size cache_alchemy-0.1.2.tar.gz (14.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page