The carbon footprint is a measure of the total amount of greenhouse gases produced to directly and indirectly support human activities, usually expressed in equivalent tons of carbon dioxide (CO2).

The carbon footprint is a subset of the ecological footprint and of the more comprehensive Life Cycle Assessment (LCA). An individual, nation, or organization’s carbon footprint can be measured by undertaking a GHG emissions assessment or other calculative activities denoted as carbon accounting.

The data is sourced from the greenhouse gas emissions per capita indicator of the OECD’s How’s Life? well-being database (dataset DSD_HSL@DF_HSL_FWB, indicator 12_9), so the figures are expressed in tonnes of CO2 equivalent per person, on an annual basis.

This series currently ends in 2020, so a date range that starts after that returns an empty DataFrame and later years are absent rather than NaN.

Also known as: CO2 emissions, carbon emissions, greenhouse gas.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Carbon Footprint for you. Just ask in plain English.

Calculate the Carbon Footprint in Python

The Carbon Footprint is available in the Economics module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_carbon_footprint as shown below.

from financetoolkit import Economics

economics = Economics(start_date="2010-01-01", end_date="2020-01-01")

economics.get_carbon_footprint(countries=['Germany', 'United States', 'Poland'])

Which returns:

  Germany United States Poland
2010 11.893 19.644 7.967
2011 11.702 18.733 7.818
2012 11.405 17.921 7.611
2013 11.599 18.119 7.283
2014 11.021 18.072 7.106
2015 10.6 17.885 7.043
2016 10.662 17.447 7.21
2017 10.661 17.211 7.497
2018 10.437 17.551 7.539

Parameters

get_carbon_footprint 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.
  • lag (int, optional): The number of periods to lag the data by.
  • 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.

The Economics module page introduces the module, and the sidebar lists all of its functions.

Share