-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Read Egg Question #1489
Comments
@andersonfrailey asked:
As you've probably figured out, Tax-Calculator reads in several CSV and JSON files both when executing from source code and when executing from a conda package. Those files are in the source code tree and are placed in the package (as an "egg", or at least this is my possibly incorrect understanding of how a Python/conda expert would put it) using information in the So, when reading one of those named files, tax-calculator code first checks for the file in the source code tree and, if it is there, reads it. If it can't find it in that directory location, then it assumes the code is running from the conda taxcalc package and calls either the If you want to see how the two Why the The documentation says this:
Reading this might lead one to think the @andersonfrailey, if you're interested in this topic, it would be a good learning experience for us all for you to try the alternative coding approach: implement the simpler code on a development branch, make a conda taxcalc package on your local computer (using the
If you get the same table output with the current and the simpler |
@martinholmer, thanks for the detailed response. I will dig into the |
@andersonfrailey said:
Thanks. Your experimentation will help all of us understand better the read_egg_* logic. |
Hi @andersonfrailey, here's some good background info for your research: In particular, I recall that this Stack Overflow post was a helpful pointer in determining how to solve the problem of reading data files from an installed package. http://stackoverflow.com/questions/6028000/python-how-to-read-a-static-file-from-inside-a-package Good luck! |
@andersonfrailey, What's your view of the status of issue #1489? Perhaps your question was not answered in an authoritative manner. I already admitted your question was beyond my Python knowledge base. But given there has been no comments added to #1489 for three weeks, do you think there are reasons to keep this issue open? |
@martinholmer I've gotten enough information from this to look further into my question on my own. Closing. |
Could someone explain how the
read_egg_csv
andread_egg_json
functions inutils.py
work? I've been reading over the documentation for pkg_resources but I still haven't been able to figure out how it all works. Thanks in advance.The text was updated successfully, but these errors were encountered: