- Suitable for time consuming computations
- How does it work:
- First run = run
- Second run = load result
- Stores result in pickle
- Checks if function args matches
- Always use newest result
from Cached import Cached
@Cached()
# possible params: Cached(force_run=False, output_path="cached_data", name="")
def func(arg):
return arg
print fun(5)
All options are optional
- force_run [True/False] Do not use cached result
- output_path [String] default=cached_data in script path, /tmp is a good idea
- name [String] default=function name, force function name - used for store and load
Feel free to contribute.
© 2015 Vít Listík, Michal Bukovský
Released under MIT licence