[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.
The EIA's Weekly Petroleum Status Report, and Short Term Energy Outlook are closely followed events for anyone watching the fossil fuels. This PR represents the first integrations of open data available from the EIA.
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.
The STEO dataset is twenty-six tables of near-term projections, which is pulled from the V2 API.
Impact:
This package contains dependencies not included in
openbb-core
:New endpoints:
obb.commodity.petroleum_status_report
(WPSR - no API key required)obb.commodity.short_term_energy_outlook
(STEO)ALRU cache (async drop-in replacement to
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.The
table
parameter has defined choices that represent all possible tables from all categories.category
and the list of tables within that category; it will raise with a message indicating which choices are valid for the given category.STEO also accepts a symbol input for targeted queries from the API route.
Testing Done:
Reviewer Notes: