iobis / pyobis

OBIS Python client
https://iobis.github.io/pyobis
MIT License
14 stars 10 forks source link

data caching? #106

Open 7yl4r opened 1 year ago

7yl4r commented 1 year ago

a nice feature to have would be to allow retention of cached data so that data does not need to be redownloaded.

ocefpaf commented 1 year ago

Based on the size of the data I would image a disk cache, right?

7yl4r commented 1 year ago

Yes, I was imagining:

To save:

to fetch before performing query:

I'm not certain if record_count is the only parameter to look at, however. Records could be updated without changing the count of records.

ocefpaf commented 1 year ago

I usually go to https://joblib.readthedocs.io/en/latest/auto_examples/memory_basic_usage.html for that kind of operation. If you choose to not save on disk we can use functools.lru_cache from the standard library.