Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

readme.md

Python Cached Decorator

MIT license

Provides caching for functions

  • 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

Example

from Cached import Cached

@Cached()
# possible params: Cached(force_run=False, output_path="cached_data", name="")
def func(arg):
    return arg

print fun(5)

Options

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

Development

Feel free to contribute.

Copyright and License

© 2015 Vít Listík, Michal Bukovský

Released under MIT licence

About

Pythod Cached Decorator providing caching for functions

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.