Tax Revenue to GDP
Get the Government Tax Revenue to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Government Tax Revenue to GDP Ratio is the ratio of the total amount of money that a government collects from taxes to the Gross Domestic Product (GDP).
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.1022 for 10.22% of GDP).
Changed in v2.2.0: this used to be returned in percentage points. It is now a decimal fraction, matching every other ratio in the Finance Toolkit.
Also known as: tax burden, tax to GDP ratio.
Tax Revenue to GDP in Python
get_government_tax_revenue_to_gdp_ratio is part of the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_government_tax_revenue_to_gdp_ratio as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2015-01-01')
economics.get_government_tax_revenue_to_gdp_ratio(
countries=['United States', 'Canada', 'Mexico'])
Which returns:
| United States | Canada | Mexico | |
|---|---|---|---|
| 2015 | 0.1994 | 0.1239 | 0.1318 |
| 2016 | 0.1958 | 0.125 | 0.1386 |
| 2017 | 0.2031 | 0.1261 | 0.134 |
| 2018 | 0.1874 | 0.1306 | 0.1336 |
| 2019 | 0.1888 | 0.1274 | 0.1348 |
| 2020 | 0.1934 | 0.135 | 0.1452 |
| 2021 | 0.2065 | 0.1322 | 0.1414 |
| 2022 | 0.2156 | 0.1283 | 0.1368 |
| 2023 | 0.1022 | 0.1401 | 0.1427 |
Parameters
get_government_tax_revenue_to_gdp_ratio accepts the following parameters:
- countries (list[str] | str | None, optional): The countries to include in the data. 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.