Skip to content
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

[Feature] Add Retail Prices to Economy #6474

Merged
merged 7 commits into from
Jun 2, 2024
Merged

Conversation

deeleeramone
Copy link
Contributor

  1. Why?:

    • Expand the breadth of macroeconomic data, these prices are used in the calculation of US CPI.
  2. What?:

    • Adds obb.economy.retail_prices() route.
    • retail_prices standard model.
    • Data from FRED for average retail prices by urban region, or all_city, for a various food and energy items.
      • region parameter is by default, all_city.
      • transform parameter allows period change, change from year ago, and percent changes.
      • frequency of monthly/quarter/annual
  3. Impact:

    • Additional models and endpoints.

    • Multiple items are not allowed, but there are groups of items that can be selected. Tested with combinations of groupings, but this lead to rate limiting, so this is the reason to not allow multiple items.

    "beverages",
    "cereals",
    "dairy",
    "fuel",
    "meats",
    "produce",

Defaults to fuel

  1. Testing Done:

    • Unit/integration
    • CLI
    • Single and group items.

Screenshot 2024-05-31 at 3 31 58 PM

Metadata is returned:

{'APU040074717': {'title': 'Average Price: Automotive Diesel Fuel (Cost per Gallon/3.785 Liters) in the West Census Region - Urban',
  'units': 'U.S. Dollars',
  'frequency': 'Monthly',
  'seasonal_adjustment': 'Not Seasonally Adjusted',
  'notes': 'All automotive diesel fuel.\n\nAverage consumer prices are calculated for household fuel, motor fuel, and food items from prices collected for the Consumer Price Index (CPI). Average prices are best used to measure the price level in a particular month, not to measure price change over time. It is more appropriate to use CPI index values for the particular item categories to measure price change.\n\nPrices, except for electricity, are collected monthly by BLS representatives in the 75 urban areas priced for the CPI. Electricity prices are collected for the BLS for the same 75 areas on a monthly basis by the Department of Energy using mail questionnaires. All fuel prices include applicable Federal, State, and local taxes; prices for natural gas and electricity also include fuel and purchased gas adjustments.\n\nFor more information, please visit the Bureau of Labor Statistics (https://www.bls.gov/cpi/factsheets/average-prices.htm).'},
 'APU024074717': {'title': 'Average Price: Automotive Diesel Fuel (Cost per Gallon/3.785 Liters) in the West North Central Census Division',
  'units': 'U.S. Dollars',
  'frequency': 'Monthly',
  'seasonal_adjustment': 'Not Seasonally Adjusted',
  'notes': 'All automotive diesel fuel.\n\nAverage consumer prices are calculated for household fuel, motor fuel, and food items from prices collected for the Consumer Price Index (CPI). Average prices are best used to measure the price level in a particular month, not to measure price change over time. It is more appropriate to use CPI index values for the particular item categories to measure price change.\n\nPrices, except for electricity, are collected monthly by BLS representatives in the 75 urban areas priced for the CPI. Electricity prices are collected for the BLS for the same 75 areas on a monthly basis by the Department of Energy using mail questionnaires. All fuel prices include applicable Federal, State, and local taxes; prices for natural gas and electricity also include fuel and purchased gas adjustments.\n\nFor more information, please visit the Bureau of Labor Statistics (https://www.bls.gov/cpi/factsheets/average-prices.htm).'},
 'APU037074717': {'title': 'Average Price: Automotive Diesel Fuel (Cost per Gallon/3.785 Liters) in the West South Central Census Division',
  'units': 'U.S. Dollars',
  'frequency': 'Monthly',
  'seasonal_adjustment': 'Not Seasonally Adjusted',
  'notes': 'All automotive diesel fuel.\n\nAverage consumer prices are calculated for household fuel, motor fuel, and food items from prices collected for the Consumer Price Index (CPI). Average prices are best used to measure the price level in a particular month, not to measure price change over time. It is more appropriate to use CPI index values for the particular item categories to measure price change.\n\nPrices, except for electricity, are collected monthly by BLS representatives in the 75 urban areas priced for the CPI. Electricity prices are collected for the BLS for the same 75 areas on a monthly basis by the Department of Energy using mail questionnaires. All fuel prices include applicable Federal, State, and local taxes; prices for natural gas and electricity also include fuel and purchased gas adjustments.\n\nFor more information, please visit the Bureau of Labor Statistics (https://www.bls.gov/cpi/factsheets/average-prices.htm).'}}

@deeleeramone deeleeramone added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels May 31, 2024
@deeleeramone deeleeramone requested a review from IgorWounds May 31, 2024 22:39
@IgorWounds IgorWounds added this pull request to the merge queue Jun 2, 2024
Merged via the queue into develop with commit 0b3e286 Jun 2, 2024
9 checks passed
@IgorWounds IgorWounds deleted the feature/retail-prices branch June 16, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants