cpi
Get Consumer Price Index (CPI).
Returns either the rescaled index value, or a rate of change (inflation).
Examples
from openbb import obb
obb.economy.cpi(country='japan,china,turkey', provider='fred')
# Use the `transform` parameter to define the reference period for the change in values. Default is YoY.
obb.economy.cpi(country='united_states,united_kingdom', transform='period', provider='oecd')
Parameters
- standard
- fred
- oecd
Name | Type | Description | Default | Optional |
---|---|---|---|---|
country | Union[str, List[str]] | The country to get data. Multiple items allowed for provider(s): fred, oecd. | united_states | True |
transform | Literal['index', 'yoy', 'period'] | Transformation of the CPI data. Period represents the change since previous. Defaults to change from one year ago (yoy). | yoy | True |
frequency | Literal['annual', 'quarter', 'monthly'] | The frequency of the data. | monthly | True |
harmonized | bool | If true, returns harmonized data. | False | True |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
Name | Type | Description | Default | Optional |
---|---|---|---|---|
country | str | The country to get data. | united_states | True |
transform | Literal['index', 'yoy', 'period'] | Transformation of the CPI data. Period represents the change since previous. Defaults to change from one year ago (yoy). | yoy | True |
frequency | Literal['annual', 'quarter', 'monthly'] | The frequency of the data. | monthly | True |
harmonized | bool | If true, returns harmonized data. | False | True |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
Name | Type | Description | Default | Optional |
---|---|---|---|---|
country | str | Country to get CPI for. This is the list of OECD supported countries | united_states | True |
transform | Literal['index', 'yoy', 'period'] | Transformation of the CPI data. Period represents the change since previous. Defaults to change from one year ago (yoy). | yoy | True |
frequency | Literal['annual', 'quarter', 'monthly'] | The frequency of the data. | monthly | True |
harmonized | bool | If true, returns harmonized data. | False | True |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
expenditure | Literal['total', 'all', 'actual_rentals', 'alcoholic_beverages_tobacco_narcotics', 'all_non_food_non_energy', 'clothing_footwear', 'communication', 'education', 'electricity_gas_other_fuels', 'energy', 'overall_excl_energy_food_alcohol_tobacco', 'food_non_alcoholic_beverages', 'fuels_lubricants_personal', 'furniture_household_equipment', 'goods', 'housing', 'housing_excluding_rentals', 'housing_water_electricity_gas', 'health', 'imputed_rentals', 'maintenance_repair_dwelling', 'miscellaneous_goods_services', 'recreation_culture', 'residuals', 'restaurants_hotels', 'services_less_housing', 'services_less_house_excl_rentals', 'services', 'transport', 'water_supply_other_services'] | Expenditure component of CPI. | total | True |
Returns
OBBject
results : List[ConsumerPriceIndex]
Serializable results.
provider : Optional[Literal['fred', 'oecd']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra : Dict[str, Any]
Extra info.
Data
- standard
- fred
- oecd
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
country | str | None |
value | float | CPI index value or period change. |
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
country | str | None |
value | float | CPI index value or period change. |
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
country | str | None |
value | float | CPI index value or period change. |
expenditure | str | Expenditure component of CPI. |