New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store data globally, or somewhere configurable #6
Comments
I'm open to a more sophisticated solution. Just tried to keep it simple for v0.0.1. One complicating factor is this library will need to update every month to stay in sync with the latest CPI values. You can see the I doubt this is the first library to grapple with this kind of problem. So I'd be interested to learn how other developers have tackled the challenge. And if we can come up with a sturdy replacement for the stupid simple system I have here, that's great. |
Totally understand needing to get a version out the door, especially on deadline. I'll look around and open a PR if I find a promising pattern. |
How about downloading the data to the global data cache after install
|
Not a bad idea. Are there other libraries that do this? |
One can't run |
If I understand what's happening, data lives and is updated here: https://github.com/datadesk/cpi/blob/master/cpi/data.csv
Two things make my queasy about this (with the caveat that I haven't used this in a project yet):
One way you could avoid that is having a global, or configurable, data cache. It might be
$HOME/.python-cpi/data.csv
by default, with the option to configure if you needed an isolated copy somewhere. The library could pre-populate the cache, or fall back on what's included in the codebase, or warn if the data is stale.The text was updated successfully, but these errors were encountered: