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.* (2019)

  • Support Method and Property Cache

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

Source Distribution

cache-alchemy-0.1.5.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cache_alchemy-0.1.5-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cache-alchemy-0.1.5.tar.gz.

File metadata

  • Download URL: cache-alchemy-0.1.5.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.1

File hashes

Hashes for cache-alchemy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 719321db8148688ffb4846cb31d592df9f2305caa6ba9ee40a0fe368a3304a5b
MD5 fe9f6dc17bf67d2d87c7aaa3c9111a6d
BLAKE2b-256 4fe1f425dfdf168e1af761093d4a1de38a0ccc1f84a73d695e1a46df0ddee78d

See more details on using hashes here.

File details

Details for the file cache_alchemy-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: cache_alchemy-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.1

File hashes

Hashes for cache_alchemy-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b74ac982727b3a25a3bf57df2dd6b58b08690eec91d61a164c81a22c4aa58041
MD5 2ff19b2301c94cbb01dadd84474f5d90
BLAKE2b-256 04b96ee07e35926f55882df1830a858d72e8fafbd0e7c07330beed88398a500e

See more details on using hashes here.

Supported by

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