Get the Government Revenue for a variety of countries over time from the Global Macro Database (GMDB). Government Revenue is the total amount of money that a government collects from taxes and other sources.

The level is annual and expressed in millions of national currency, so levels are not comparable across countries with different currencies, but growth rates are.

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: government income, public revenue.

Government Revenue in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_government_revenue as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2019-01-01', end_date="2025-12-31")

economics.get_government_revenue(countries=['United Kingdom', 'Canada', 'Japan'])

Or, after setting up the Finance Toolkit MCP, ask:

How much revenue did the governments of the United Kingdom, Canada and Japan collect each year, in national currency, from 2019 to 2025?

Which returns:

  United Kingdom Canada Japan
2019 856511 938667 1.97133e+08
2020 825025 919593 1.97357e+08
2021 917948 1.07553e+06 2.07143e+08
2022 1.04634e+06 1.17518e+06 2.16838e+08
2023 1.10774e+06 1.23487e+06 2.24713e+08
2024 1.1523e+06 1.31248e+06 2.33044e+08
2025 1.23387e+06 1.36827e+06 2.44853e+08

Parameters

get_government_revenue accepts the following parameters.

ParameterTypeDescriptionExample
countrieslist[str] | str | NoneA list of countries or a single country to include in the results. Defaults to None.["United States", "Germany"]
levelstrThe government the figures cover: “consolidated” (the Global Macro Database’s combination of general and central government figures, with the longest history), “general” (general government: central, state and local government and social security) or “central” (central government only). Defaults to “consolidated”."general"
rollingintThe rolling window size to use for smoothing the data (simple moving average). Defaults to None.4
trailingintThe trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.4
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagintThe number of periods to lag the growth data. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
gmdb_forecastsboolWhether 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
Share