[Feature] Add EIA Provider & Weekly Petroleum Status Report #6693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is marked as Do Not Merge because the package name -
openbb-eia
- is currently occupied and may need to change. This PR is being opened for testing and preliminary review and I will remove the label when those details are sorted.The EIA's Weekly Petroleum Status Report is a closely followed event for anyone watching the fossil fuels
The WPSR is comprised of thirteen (excludes discontinued series) high-level categories with each containing a subset of tables. Data is from the static Excel files published here, and each file represents a single category.
All data from a single category is returned by supplying "all" to the
table
parameter of the WPSR endpoint.Tables from the WPSR are returned in a flat format in the same order as presented in the Excel files. The response is suitable for pivot tables and SQL storage.
Impact:
functools.lru_cache
) is used for the WPSR files that retains each "category" requested for the duration of the Python session. Settinguse_cache
asFalse
will invalidate the cache and download the file again.table
parameter has defined choices that represent all possible tables from all categories. A custom validator checks this parameter against thecategory
and the list of tables within that category; it will raise with a message indicating which choices are valid for the given category.Testing Done:
Reviewer Notes:
eia_api_key
.