cachier icon indicating copy to clipboard operation
cachier copied to clipboard

Allow to globally specify the location of the cache dir

Open shaypal5 opened this issue 4 years ago • 1 comments

In addition to configuring the cache file path for each wrapped function, a way to globally change the location of the general cache directory for all cachier caches is required.

A possible API:

>>> import cachier
>>> cachier.get_global_cache_dpath()
'/home/myuser/.cachier'
>>> cachier.set_global_cache_dpath('/home/opt/caches/')
>>> cachier.get_global_cache_dpath()
'/home/opt/caches/'

shaypal5 avatar May 22 '21 11:05 shaypal5

I wouldn't make this a priority. The current API is not that cumbersome. If this does happen, I might suggest using default instead of global (as I assume it could be overridden still). And use dir instead of dpath. So it would be get_default_cache_dir().

Alternatively, do you need the complex logic of a function or can you get away with cachier.defaut_cache_dir = "/foo"?

NickCrews avatar Mar 07 '22 16:03 NickCrews