Is there a way to memoize the output of a function to disk?
I have a function
def getHtmlOfUrl(url): ... # expensive computation
There is also diskcache.
from diskcache import Cache cache = Cache("cachedir") @cache.memoize() def f(x, y): print('Running f({}, {})'.format(x, y)) return x, y