Skip to main content

twig-emissions-indicators

Python

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 document right here.

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.

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,
}

To do:

  • Clean "store_results" part
  • 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.0

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.0
File Size Uploaded Provenance Actions
twig_emissions_indicators-0.1.0.tar.gz 13.5 kB Without provenance Details for twig_emissions_indicators-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 27.4 kB

Release files / twig_emissions_indicators-0.1.0.tar.gz

Download URL twig_emissions_indicators-0.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
190a0b106d6a690db87b265a676e4406b4584fdef2c340c702f5d5a1ed5dc642
BLAKE2b-256 checksum
How to use checksums
e590b326e092eecbb438cd7f020980496ab24524c06e81c6d216fbf72f046f6f
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.0-py3-none-any.whl

Download URL twig_emissions_indicators-0.1.0-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aaaf1f53412d6b56cbbe2e5b6609a41ac0ded879bd014c98fbbf56f6483a750a
BLAKE2b-256 checksum
How to use checksums
229910a267f9152a7412185f1d10b0d1954890cd0cb5b15326db5affc48fd1b0
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.0

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