Skip to content

A python decorator which helps cache a result of a function

License

Notifications You must be signed in to change notification settings

deepakmishra/cache_function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A python decorator which helps cache a result of a function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages