Consumption to GDP
Get the Total Consumption to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Total Consumption to GDP Ratio is final consumption expenditure (households, the non-profit institutions serving them and the government) as a share of the Gross Domestic Product (GDP). Select the household or government part with the component parameter.
Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html
The ratio is expressed as a decimal fraction (0.8100 for 81.00% of GDP).
The ratio is the Global Macro Database’s own figure, published in percent and divided by 100 here.
The formula is as follows:
\[\text{Consumption to GDP Ratio} = \text{Final Consumption Expenditure} / \text{Nominal GDP},\;\; \text{with the total (households, the non-profit institutions serving them and the government)},\;\; \text{household or government part selected with component ("total" by default)}\]Also known as: consumption share of GDP.
Consumption to GDP in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_total_consumption_to_gdp_ratio as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2018-01-01', end_date="2025-12-31")
total_consumption_to_gdp_ratio = economics.get_total_consumption_to_gdp_ratio()
total_consumption_to_gdp_ratio.loc[:, ['Netherlands', 'France', 'Poland']]
Or, after setting up the Finance Toolkit MCP, ask:
What share of GDP did total consumption take in the Netherlands, France and Poland from 2018 to 2025?
Which returns:
| Netherlands | France | Poland | |
|---|---|---|---|
| 2018 | 0.6896 | 0.7833 | 0.7655 |
| 2019 | 0.6828 | 0.7757 | 0.7572 |
| 2020 | 0.6838 | 0.7892 | 0.755 |
| 2021 | 0.6805 | 0.7784 | 0.7496 |
| 2022 | 0.6836 | 0.7871 | 0.7637 |
| 2023 | 0.6997 | 0.7873 | 0.7662 |
| 2024 | 0.6927 | 0.7878 | 0.7793 |
| 2025 | 0.6895 | 0.7838 | 0.7901 |
Parameters
get_total_consumption_to_gdp_ratio accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
countries | list[str] | str | None | A list of countries or a single country to include in the results. Defaults to None. | ["United States", "Germany"] |
component | str | The part of final consumption expenditure: “total”, “household” (households and the non-profit institutions serving them) or “government”. Defaults to “total”. | "household" |
rolling | int | The rolling window size to use for smoothing the data (simple moving average). Defaults to None. | 4 |
trailing | int | The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None. | 4 |
growth | bool | Whether to return the growth data or the actual data. Defaults to False. | True |
lag | int | The number of periods to lag the growth data. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
gmdb_forecasts | bool | Whether to include the years the Global Macro Database projects, from the IMF’s World Economic Outlook, up to five years ahead. Only applies to data from the Global Macro Database. Defaults to False, which ends a series with its last observation. | True |