Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 756 Bytes

README.md

File metadata and controls

44 lines (35 loc) · 756 Bytes

cacheer

On-disk caching

Installation

pip install git+https://github.com/Notmeor/cacheer.git

Usage

from cacheer.manager import cache_manager

@cache_manager.cache()
def some_function(*args, **kw):
    pass

Check whether we're in caching mode

cache_manager.is_using_cache()

Disable caching

cache_manager.disable()

Enable cacheing when it's previously disabled

cache_manager.enable()

Disable caching with context manager

with cache_manager.cache.no_cache():
    some_function()

Run a function while declaring its existing cache outdated (so its cache would be recreated/updated after this call)

with cache_manager.cache.outdate():
    some_function()