Skip to main content

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, decode_responses=True)

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

  • Support Partially Clear Cache with Arguments

  • Cache Redis Client Must Decode Responses

0.1.* (2019)

  • Support Method and Property Cache

  • Support cache as a decorator with no arguments.

  • Init Project.

Metadata

Release files for cache-alchemy 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cache-alchemy 0.2.2
File Size Uploaded
cache-alchemy-0.2.2.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cache-alchemy 0.2.2
File Interpreter ABI Platform
cache_alchemy-0.2.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 28.1 kB

Release files / cache-alchemy-0.2.2.tar.gz

Download URL cache-alchemy-0.2.2.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d5cc9493074d1f2b5ad3b1dd9db9387107dbef27432d8324127058e1e9bc38b8
BLAKE2b-256 checksum
How to use checksums
bdca2663de628fd14606f88ada1a7121bb4ae0ffed8a424b570c3b750803787f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / cache_alchemy-0.2.2-py2.py3-none-any.whl

Download URL cache_alchemy-0.2.2-py2.py3-none-any.whl
Size 10.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c43b6e811f0575ac2b7508d2f92eef4050d57a057d73006999d1e9c45e978768
BLAKE2b-256 checksum
How to use checksums
b6658ab483789f34780cff73c214d5fb00a2b3779e4585c5cd3c704d614e757c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page