Skip to main content

twig-emissions-indicators

Python Poetry Ruff

Python package for quantification of CO2 intensities of european electricity bidding zones. It relies on ENTSO-E data from the ENTSO-E Transparency Platform.

The accounting method is following a multi-regional input output approach developed in the following paper: Evaluation Method for the Hourly Average CO2eq. Intensity of the Electricity Mix and Its Application to the Demand Response of Residential Heating and further developed in the following documentation available in the github repository.

Through the MRIO method, average emissions factors are calculated. Then, a Linear Model Tree is trained to quantify the marginal emissions factors. For further information, please refer to the documentation available in the github repository.

The core functionalities of the twig-emissions-indicators package are:

  • entsoe data loading
  • data processing through MRIO approach
  • Linear Model Tree Training for Marginal Emissions Factors quantification

Installation

pip install twig-emissions-indicators

Usage

Data Loading and MRIO Calculation

In order to use the twig-emissions-indicators package and generate the needed data for the Linear Model Tree training, you need to first load the ENTSO-E data using the DataLoader class through the MRIO approach.

from twig_emissions_indicators.data import DataLoader
from twig_emissions_indicators.mrio import CalculatorMRIO

ENTSOE_TOKEN = "Your ENTSO-E token"
period_start = pd.Timestamp('20250101', tz='Europe/Brussels')
period_end = pd.Timestamp('20251231', tz='Europe/Brussels')

data_loader = DataLoader(start=period_start, 
                         end=period_end, 
                         api_key=ENTSOE_TOKEN, 
                         dir=Path("folder_path_for_entsoe_data"))
calc = CalculatorMRIO(data_loader, bidding_zone='DK_2')
calc.store_results(results_folder="folder_path_for_results")

In the above example, the DataLoader is used to load the ENTSO-E data, and the CalculatorMRIO is used to process the data through the MRIO approach. The results are then stored in the specified folder.

This step is necessary to generate the data needed for the Linear Model Tree training.

Linear Model Tree Training

Once the data is loaded and processed, you can train the Linear Model Tree using the LinearModelTree class.


CO2 intensity factors

For each generator, the CO2 intensity factor is defined from IPCC data and are gathered in the twig_emissions_indicators.config module. Potential neighbors zones that do not have ENTSOE data are assigned a default value from the EMISSION_FACTORS dictionary. This default dataset can be overridden by providing a custom emissions factors dictionary when initializing the DataLoader, under the emissions_factors parameter.

# Emission factors (kgCO2eq/MWh)
EMISSION_FACTORS = {
    "Fossil Hard coal": 820,
    "Fossil Gas":       490,
    "Nuclear":          12,
    "Wind Onshore":     11,
    "Wind Offshore":    12,
    "Solar":            48,
    "Hydro":            24,
    "Biomass":          230,
    "Fossil Oil":       840,
    "Fossil Brown coal/Lignite": 820,
    "Fossil Coal-derived gas": 820,
    "Fossil Peat": 820,
    "Geothermal": 38,
    "Waste": 230,
    "Other": 258,
    "Other renewable": 48,
    "Hydro Pumped Storage": 24,
    "Hydro Run-of-river and poundage": 24,
    "Hydro Water Reservoir": 24,
    "Energy storage": 358,
    "Marine": 10,
    # Imports # Electricity Maps 2024
    "Import_GB": 175,
    "Import_EE": 291,
    "Import_RU": 354.0,
}

Dependencies

The package depends on the following libraries:

  • pandas (>=3.0.5,<4.0.0)
  • entsoe-py (>=0.8.0,<0.9.0)
  • matplotlib (>=3.11.1,<4.0.0)

Roadmap

  • Add the Linear Tree Model Part
    • Training script
    • Comparison with other models
  • Add the Data Vizualization part

Metadata

Release files for twig-emissions-indicators 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twig-emissions-indicators 0.1.2
File Size Uploaded Provenance Actions
twig_emissions_indicators-0.1.2.tar.gz 13.8 kB Without provenance Details for twig_emissions_indicators-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for twig-emissions-indicators 0.1.2
File Interpreter ABI Platform Actions
twig_emissions_indicators-0.1.2-py3-none-any.whl Python 3 none any Details for twig_emissions_indicators-0.1.2-py3-none-any.whl

Total release size: 28.0 kB

Release files / twig_emissions_indicators-0.1.2.tar.gz

Download URL twig_emissions_indicators-0.1.2.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
833bbc1bc9b6fbcf05d653bb84444f9773ceca1699b8849d1c6d0ddbecab7514
BLAKE2b-256 checksum
How to use checksums
8a52a131b622fe14ae43f4c024846d5e3b6d7d5a3ebdf32c0eb8417d5afac969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.6 Darwin/25.2.0

Release files / twig_emissions_indicators-0.1.2-py3-none-any.whl

Download URL twig_emissions_indicators-0.1.2-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23ef6d3077fd24cb6f24cef0f5ca6298c4f7fa6f752fcb9c0fbb9fedc6f49424
BLAKE2b-256 checksum
How to use checksums
4449236738916707df921de2aaba6c4c379de1159c29ccaf4c4a6991176d57ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.6 Darwin/25.2.0

Security for twig-emissions-indicators 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page