Skip to main content

A python API wrapper for transparency.entsog.eu

Project description

Entsog-py

Python client for the ENTSO-G API (european network of transmission system operators for gas)

Documentation of the API found on https://transparency.entsog.eu/api/archiveDirectories/8/api-manual/TP_REG715_Documentation_TP_API%20-%20v2.1.pdf

Documentation of the data (user manual) found on https://www.entsog.eu/sites/default/files/2021-07/ENTSOG%20-%20TP%20User%20Manual_v_4.5.pdf

Heavily inspired upon (and forked from) https://github.com/EnergieID/entsoe-py

Installation

python3 -m pip install entsog-py

Usage

The package comes with 2 clients:

It's preferable to use the Pandas Client as this will handle most API limitations itself. However, if you want to obtain the pure raw data; you can use the raw client.

Example Use Case

On wwww.gasparency.com you can find example use cases of the data. Almost everything there is achieved with the help of this package!

EntsogRawClient

from entsog import EntsogRawClient
import pandas as pd

client = EntsogRawClient()

start = pd.Timestamp('20171201', tz='Europe/Brussels')
end = pd.Timestamp('20180101', tz='Europe/Brussels')
country_code = 'NL'  # Netherlands

client.query_connection_points()
client.query_operators()
client.query_balancing_zones()
client.query_operator_point_directions(country_code)
client.query_interconnections()
client.query_aggregate_interconnections()
client.query_urgent_market_messages()
client.query_tariffs(start = start, end = end, country_code = country_code)
client.query_tariffs_sim(start = start, end = end, country_code = country_code)

    operational_options = {   
    interruption_capacity : "Actual interruption of interruptible capacity",
    allocation : "Allocation",
    firm_available : "Firm Available",
    firm_booked : "Firm Booked",
    firm_interruption_planned : "Firm Interruption Planned - Interrupted",
    firm_interruption_unplanned :"Firm Interruption Unplanned - Interrupted",
    firm_technical : "Firm Technical",
    gcv : "GCV",
    interruptible_available : "Interruptible Available",
    interruptible_booked : "Interruptible Booked",
    interruptible_interruption_actual : "Interruptible Interruption Actual – Interrupted",
    interruptible_interruption_planned : "Interruptible Interruption Planned - Interrupted",
    interruptible_total : "Interruptible Total",
    nominations : "Nominations",
    physical_flow : "Physical Flow",
    firm_interruption_capacity_planned : "Planned interruption of firm capacity",
    renomination : "Renomination",
    firm_interruption_capacity_unplanned : "Unplanned interruption of firm capacity",
    wobbe_index : "Wobbe Index",
    oversubscription_available : "Available through Oversubscription",
    surrender_available : "Available through Surrender",
    uioli_available_lt : "Available through UIOLI long-term",
    uioli_available_st : "Available through UIOLI short-term"}

client.query_operational_data(start = start, end = end, country_code = country_code, indicator = ['renomination', 'physical_flow'])

EntsogPandasClient

The Pandas Client works similar to the Raw Client, with extras:

  • API limitations of big requests are automatically dealt with and put into multiple calls.
  • Tariffs (and simulated tariffs) can be melted into nice storable format. Instead of having row with EUR, local currency, shared currency for each seperate product, it will create a row for each.
  • Operational data can be either requested as in the raw format (which requires some loading time) or in an aggregate function query_operational_data_all which will aggressively request all points in Europe and a lot faster.
  • It's easier to navigate points, for instance if you want to check gazprom points. See below.
from entsog import EntsogPandasClient
import pandas as pd

client = EntsogPandasClient()

start = pd.Timestamp('20171228', tz='Europe/Brussels')
end = pd.Timestamp('20180101', tz='Europe/Brussels')
country_code = 'NL'  # Netherlands

client.query_connection_points()
client.query_operators(country_code)
client.query_balancing_zones()
client.query_operator_point_directions()
client.query_interconnections()
client.query_aggregate_interconnections()
client.query_urgent_market_messages()


client.query_tariffs(start = start, end = end, country_code = country_code, melt = True, verbose = True)
client.query_tariffs_sim(start = start, end = end, country_code = country_code, verbose = True)

client.query_aggregated_data(start = start, end = end, country_code = country_code)
# TODO: Add interruptions...
# client.query_interruptions(start = start, end = end)
client.query_CMP_auction_premiums(start = start, end = end)
client.query_CMP_unavailable_firm_capacity(start = start, end = end)

client.query_CMP_unsuccesful_requests(start = start, end = end)

operational_options = {   
    'interruption_capacity' : "Actual interruption of interruptible capacity",
    'allocation' : "Allocation",
    'firm_available' : "Firm Available",
    'firm_booked' : "Firm Booked",
    'firm_interruption_planned' : "Firm Interruption Planned - Interrupted",
    'firm_interruption_unplanned' :"Firm Interruption Unplanned - Interrupted",
    'firm_technical' : "Firm Technical",
    'gcv' : "GCV",
    'interruptible_available' : "Interruptible Available",
    'interruptible_booked' : "Interruptible Booked",
    'interruptible_interruption_actual' : "Interruptible Interruption Actual – Interrupted",
    'interruptible_interruption_planned' : "Interruptible Interruption Planned - Interrupted",
    'interruptible_total' : "Interruptible Total",
    'nominations' : "Nominations",
    'physical_flow' : "Physical Flow",
    'firm_interruption_capacity_planned' : "Planned interruption of firm capacity",
    'renomination' : "Renomination",
    'firm_interruption_capacity_unplanned' : "Unplanned interruption of firm capacity",
    'wobbe_index' : "Wobbe Index",
    'oversubscription_available' : "Available through Oversubscription",
    'surrender_available' : "Available through Surrender",
    'uioli_available_lt' : "Available through UIOLI long-term",
    'uioli_available_st' : "Available through UIOLI short-term"
}

client.query_operational_data(start = start, end = end, country_code = country_code, indicators = ['renomination', 'physical_flow'])
# You should use this when you want to query operational data for the entirety of continental europe.
client.query_operational_data_all(start = start, end = end, indicators = ['renomination', 'physical_flow'])
# Example for if you would like to see Gazprom points.
points = client.query_operator_point_directions()
mask = points['connected_operators'].str.contains('Gazprom')
masked_points = points[mask]
print(masked_points)

keys = []
for idx, item in masked_points.iterrows():
    keys.append(f"{item['operator_key']}{item['point_key']}{item['direction_key']}")

data = client.query_operational_point_data(start = start, end = end, indicators = ['physical_flow'], point_directions = keys, verbose = False)

print(data.head())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entsog-py-0.9.3.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entsog_py-0.9.3-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file entsog-py-0.9.3.tar.gz.

File metadata

  • Download URL: entsog-py-0.9.3.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for entsog-py-0.9.3.tar.gz
Algorithm Hash digest
SHA256 c5350b27856ac1a88207209f70ce959674195743d3331e21b70c90c2201b648c
MD5 eccb9c07c746c20ba9bbb6768fb3563d
BLAKE2b-256 4fb0ea822454ac5032960689411df9ee31c3c4c8a32826e4b080caee65b624d8

See more details on using hashes here.

File details

Details for the file entsog_py-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: entsog_py-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for entsog_py-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a48b28db70e425b6471501c14f2363fc4b0b538c4465f2d820f1e723e0fd5adb
MD5 d3e9584b20050ebba2ed3c81c2676c54
BLAKE2b-256 82434c12e3890421d39f4da2a2d0b0fa37c8566f407b8006a418843f18507c69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page