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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05944f1ba6846947a31e888e043d441f0e0b32927646391fed0dec38407ea1ef |
|
MD5 | 94d26e0af7bc797b9c8c8ab332189999 |
|
BLAKE2b-256 | 03cd372e03e765dccbe9bb2cab2bd818ae6923c0008a71701430bc467cc0f639 |
Close
Hashes for cache_function_deepakmishra-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a881f62403bafb232377972ab64f69b5a5feaf9630312361388fb161fc2f38a5 |
|
MD5 | 90c72efac19e9b760acfa3143ea1d22e |
|
BLAKE2b-256 | 59bffbb3f9b5b93902ea4174bcf427818bb11415bd42b61ed79cc34fd16ddfed |