Skip to main content

Package to fast and easy cache

Project description

my Sweet Cache

This project let make fast and simply cache

autors

Bartłomiej Chwiłkowski (github: chwilko)

Structure

mySweetCache: mySweetCache.py: main functions utils.py: other function usefull to

Functions

cache: decorator to cache the result of the function use_par: decorator to set first function argument use_pars: decorator to set first function arguments

How to use

@cache("key")
def long_counting_function():
    ...

long_counting_function()

After first call this function result is saved in .MScache_files/key In next call instead recount value will be read from cache. To recount call long_counting_function(use_cache=False) then cache will be overwrited or delete .MScache_files/try file.

WARNING! If you define two function with the same key, there two functions will share the same cache file.

Licence

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysweetcache-0.1.0.tar.gz (538.1 kB view hashes)

Uploaded Source

Built Distribution

mysweetcache-0.1.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page