A small decorator which helps cache a result of a function
Project description
Cache Function
You can use this python decorator Github-flavored Markdown to cache a result of a function.
Installation
pip install -i https://test.pypi.org/simple/ cache-function-deepakmishra
Usage
Production Setting
from cache_function import cache_function
cache_function.cache = **your cache object which has get and set functions**
Development Setting
from cache_function import cache_function, test_cache_function
cache_function.cache = test_cache_function.DummyCache()
Usage: Cache a function result
from cache_function.cache_function import cache_function
@cache_function(expiry=30) # time in seconds
def foo(a, b, c):
return a + b + c
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cache-function-deepakmishra-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af1c73c13974081b26cdf8b15bd37612cb6c462b5d558d5c466274ca33807f03 |
|
MD5 | adefee947402294d160e2e8becd7c3c5 |
|
BLAKE2b-256 | 4992eef19642972cbb5949b6a36476979985cf73adc00a02f4abf9712be5055a |
Close
Hashes for cache_function_deepakmishra-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1fc4ee57940ad80bf77acab95f71b1d89065426e422efb52e48b9e4568259e7 |
|
MD5 | e68014b646d80ec03c88857229cb3a02 |
|
BLAKE2b-256 | 390e719b82bde24fb85d683c123c44a3e4065d79a1d089f1505864517a7fdfd1 |