معرفی شرکت ها


filecache-0.81


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Persistent caching decorator
ویژگی مقدار
سیستم عامل -
نام فایل filecache-0.81
نام filecache
نسخه کتابخانه 0.81
نگهدارنده []
ایمیل نگهدارنده []
نویسنده ubershmekel
ایمیل نویسنده ubershmekel@gmail.com
آدرس صفحه اصلی https://github.com/ubershmekel/filecache
آدرس اینترنتی https://pypi.org/project/filecache/
مجوز -
filecache filecache is a decorator which saves the return value of functions even after the interpreter dies. For example this is useful on functions that download and parse webpages. All you need to do is specify how long the return values should be cached (use seconds, like time.sleep). USAGE: from filecache import filecache @filecache(24 * 60 * 60) def time_consuming_function(args): # etc @filecache(filecache.YEAR) def another_function(args): # etc NOTE: All arguments of the decorated function and the return value need to be picklable for this to work. NOTE: The cache isn't automatically cleaned, it is only overwritten. If your function can receive many different arguments that rarely repeat, your cache may forever grow. One day I might add a feature that once in every 100 calls scans the db for outdated stuff and erases. NOTE: This is less useful on methods of a class because the instance (self) is cached, and if the instance isn't the same, the cache isn't used. This makes sense because class methods are affected by changes in whatever is attached to self. Tested on python 2.7 and 3.1 License: BSD, do what you wish with this. Could be awesome to hear if you found it useful and/or you have suggestions. ubershmekel at gmail A trick to invalidate a single value: @filecache.filecache def somefunc(x, y, z): return x * y * z del somefunc._db[filecache._args_key(somefunc, (1,2,3), {})] # or just iterate of somefunc._db (it's a shelve, like a dict) to find the right key.


نحوه نصب


نصب پکیج whl filecache-0.81:

    pip install filecache-0.81.whl


نصب پکیج tar.gz filecache-0.81:

    pip install filecache-0.81.tar.gz