The FunctionCacher Python utility provides a way to cache the result of a (computation- or IO-heavy) function call to a location on the filesystem, ideally onto a ramdisk/tmpfs.
This allows caches to exceed the lifetime of the program, which is useful for rapid-prototyping (& rapid-crashing) scripts.
Caches are generated based function name, parameters, and code.
MIT Licence.
I think Joblib Memory does the trick even better. <a href="https://joblib.readthedocs.io/en/latest/auto_examples/memory_basic_usage.html" rel="nofollow">https://joblib.readthedocs.io/en/latest/auto_examples/memory...</a>