GDP Deflator
Get the Gross Domestic Product Deflator for a variety of countries over time from the Global Macro Database (GMDB). The GDP deflator is a measure of the price of all domestically produced final goods and services in an economy relative to the price level in a base year which can vary per country.
The deflator is an index, set to 100 in the base year, which can vary per country, and is annual.
Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html
Also known as: GDP deflator, implicit price deflator.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the GDP Deflator for you. Just ask in plain English.
Calculate the GDP Deflator in Python
The GDP Deflator is available in the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_gross_domestic_product_deflator as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2015-01-01')
economics.get_gross_domestic_product_deflator(countries=['United States', 'Canada', 'Russian Federation'])
Which returns:
| United States | Canada | Russian Federation | |
|---|---|---|---|
| 2015 | 97.3159 | 96.7993 | 67.6025 |
| 2016 | 98.2406 | 97.4935 | 69.5253 |
| 2017 | 100 | 100 | 73.2441 |
| 2018 | 102.291 | 101.651 | 80.5677 |
| 2019 | 103.979 | 103.223 | 83.1968 |
| 2020 | 105.361 | 104.328 | 83.9441 |
| 2021 | 110.172 | 112.325 | 100 |
| 2022 | 118.026 | 120.922 | 115.743 |
| 2023 | 122.273 | 122.778 | 123.871 |
| 2024 | 125.195 | 126.443 | 136.148 |
| 2025 | 127.469 | 129.463 | 142.557 |
Parameters
get_gross_domestic_product_deflator accepts the following parameters:
- countries (list[str] | str | None, optional): A list of countries or a single country to include in the results. Defaults to None.
- rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
- trailing (int, optional): The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.
- growth (bool, optional): Whether to return the growth data or the actual data. Defaults to False.
- lag (int, optional): The number of periods to lag the growth data. Defaults to 1.
- standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
- rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Related Government
The Economics module page introduces the module, and the sidebar lists all of its functions.