Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: andrea-sannino
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 1.75 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

entsoe-py

Python client for the ENTSO-E API (european network of transmission system operators for electricity)

Documentation of the API found on https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html

Installation

python3 -m pip install entsoe-py

Usage

The package comes with 2 clients: - EntsoeRawClient: Returns data in its raw format, usually XML or a ZIP-file containing XML's - EntsoePandasClient: Returns data parsed as a Pandas Series or DataFrame

EntsoeRawClient

```python from entsoe import EntsoeRawClient import pandas as pd

client = EntsoeRawClient(api_key=)

start = pd.Timestamp('20171201', tz='Europe/Brussels') end = pd.Timestamp('20180101', tz='Europe/Brussels') countrycode = 'BE' # Belgium countrycodefrom = 'FR' # France countrycodeto = 'DELU' # Germany-Luxembourg typemarketagreementtype = 'A01' contractmarketagreementtype = 'A01' process_type = 'A51'

methods that return XML

client.querydayaheadprices(countrycode, start, end) client.querynetposition(countrycode, start, end, dayahead=True) client.queryload(countrycode, start, end) client.queryloadforecast(countrycode, start, end) client.querywindandsolarforecast(countrycode, start, end, psrtype=None) client.queryintradaywindandsolarforecast(countrycode, start, end, psrtype=None) client.querygenerationforecast(countrycode, start, end) client.querygeneration(countrycode, start, end, psrtype=None) client.querygenerationperplant(countrycode, start, end, psrtype=None) client.queryinstalledgenerationcapacity(countrycode, start, end, psrtype=None) client.queryinstalledgenerationcapacityperunit(countrycode, start, end, psrtype=None) client.querycrossborderflows(countrycodefrom, countrycodeto, start, end) client.queryscheduledexchanges(countrycodefrom, countrycodeto, start, end, dayahead=False) client.querynettransfercapacitydayahead(countrycodefrom, countrycodeto, start, end) client.querynettransfercapacityweekahead(countrycodefrom, countrycodeto, start, end) client.querynettransfercapacitymonthahead(countrycodefrom, countrycodeto, start, end) client.querynettransfercapacityyearahead(countrycodefrom, countrycodeto, start, end) client.queryintradayofferedcapacity(countrycodefrom, countrycodeto, start, end, implicit=True) client.queryofferedcapacity(countrycodefrom, countrycodeto, start, end, contractmarketagreementtype, implicit=True) client.querycontractedreserveprices(countrycode, start, end, typemarketagreementtype, psrtype=None) client.querycontractedreserveamount(countrycode, start, end, typemarketagreementtype, psrtype=None) client.queryprocuredbalancingcapacity(countrycode, start, end, processtype, typemarketagreementtype=None) client.queryaggregatewaterreservoirsandhydrostorage(country_code, start, end)

methods that return ZIP (bytes)

client.queryimbalanceprices(countrycode, start, end, psrtype=None) client.queryunavailabilityofgenerationunits(countrycode, start, end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.queryunavailabilityofproductionunits(countrycode, start, end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.queryunavailabilitytransmission(countrycodefrom, countrycodeto, start, end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.querywithdrawnunavailabilityofgenerationunits(countrycode, start, end) ```

Dump result to file

```python xmlstring = client.querydayaheadprices(countrycode, start, end) with open('outfile.xml', 'w') as f: f.write(xmlstring)

zipbytes = client.queryunavailabilityofgenerationunits(countrycode, start, end) with open('outfile.zip', 'wb') as f: f.write(zip_bytes) ```

Making another request

Is the API-call you want not in the list, you can lookup the parameters yourself in the API documentation python params = { 'documentType': 'A44', 'in_Domain': '10YBE----------2', 'out_Domain': '10YBE----------2' } response = client._base_request(params=params, start=start, end=end) print(response.text)

EntsoePandasClient

The Pandas Client works similar to the Raw Client, with extras: - Time periods that span more than 1 year are automatically dealt with - Requests of large numbers of files are split over multiple API calls

Please note that this client requires you to specifically set a start= and end= parameter which should be a pandas timestamp with timezone. If not it will throw an exception ```python from entsoe import EntsoePandasClient import pandas as pd

client = EntsoePandasClient(api_key=)

start = pd.Timestamp('20171201', tz='Europe/Brussels') end = pd.Timestamp('20180101', tz='Europe/Brussels') countrycode = 'BE' # Belgium countrycodefrom = 'FR' # France countrycodeto = 'DELU' # Germany-Luxembourg typemarketagreementtype = 'A01' contractmarketagreementtype = "A01" process_type = 'A51'

methods that return Pandas Series

client.querydayaheadprices(countrycode, start=start, end=end) client.querynetposition(countrycode, start=start, end=end, dayahead=True) client.querycrossborderflows(countrycodefrom, countrycodeto, start=start, end=end) client.queryscheduledexchanges(countrycodefrom, countrycodeto, start=start, end=end, dayahead=False) client.querynettransfercapacitydayahead(countrycodefrom, countrycodeto, start=start, end=end) client.querynettransfercapacityweekahead(countrycodefrom, countrycodeto, start=start, end=end) client.querynettransfercapacitymonthahead(countrycodefrom, countrycodeto, start=start, end=end) client.querynettransfercapacityyearahead(countrycodefrom, countrycodeto, start=start, end=end) client.queryintradayofferedcapacity(countrycodefrom, countrycodeto, start=start, end=end, implicit=True) client.queryofferedcapacity(countrycodefrom, countrycodeto, contractmarketagreementtype, start=start, end=end, implicit=True) client.queryaggregatewaterreservoirsandhydrostorage(country_code, start=start, end=end)

methods that return Pandas DataFrames

client.queryload(countrycode, start=start, end=end) client.queryloadforecast(countrycode, start=start, end=end) client.queryloadandforecast(countrycode, start=start, end=end) client.querygenerationforecast(countrycode, start=start, end=end) client.querywindandsolarforecast(countrycode, start=start, end=end, psrtype=None) client.queryintradaywindandsolarforecast(countrycode, start=start, end=end, psrtype=None) client.querygeneration(countrycode, start=start, end=end, psrtype=None) client.querygenerationperplant(countrycode, start=start, end=end, psrtype=None, includeeic=False) client.queryinstalledgenerationcapacity(countrycode, start=start, end=end, psrtype=None) client.queryinstalledgenerationcapacityperunit(countrycode, start=start, end=end, psrtype=None) client.queryimbalanceprices(countrycode, start=start, end=end, psrtype=None) client.querycontractedreserveprices(countrycode, typemarketagreementtype, start=start, end=end, psrtype=None) client.querycontractedreserveamount(countrycode, typemarketagreementtype, start=start, end=end, psrtype=None) client.queryunavailabilityofgenerationunits(countrycode, start=start, end=end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.queryunavailabilityofproductionunits(countrycode, start, end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.queryunavailabilitytransmission(countrycodefrom, countrycodeto, start=start, end=end, docstatus=None, periodstartupdate=None, periodendupdate=None) client.querywithdrawnunavailabilityofgenerationunits(countrycode, start, end) client.queryphysicalcrossborderallborders(countrycode, start, end, export=True) client.querygenerationimport(countrycode, start, end) client.queryprocuredbalancingcapacity(countrycode, processtype, start=start, end=end, typemarketagreementtype=None)

```

Dump result to file

See a list of all IO-methods on https://pandas.pydata.org/pandas-docs/stable/io.html python ts = client.query_day_ahead_prices(country_code, start=start, end=end) ts.to_csv('outfile.csv')

Mappings

These lists are always evolving, so let us know if something's inaccurate!

All mappings can be found in mappings.py here

For bidding zone that have changed (splitted/merged) some codes are only valid for certain times. The below table shows these cases.

| | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | | -- | -- | -- | -- | -- | -- | -- | -- | | DEATLU | yes | yes | yes | yes | No Value | No Value | No Value | | DE | No Value | No Value | No Value | No Value | No Value | No Value | No Value | | DE_LU | No Value | No Value | No Value | yes | yes | yes | yes | | AT | No Value | No Value | No Value | yes | yes | yes | yes |

Owner

  • Login: andrea-sannino
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
title: entsoe-py
message: >-
  "If you use this software, please cite it as
  below."
type: software
authors:
  - given-names: Jan
    family-names: Pecinovsky
    email: janpecinovsky@gmail.com
    affiliation: EnergieID
  - given-names: Frank
    family-names: Boerman
    email: frank@fboerman.nl

GitHub Events

Total
Last Year

Dependencies

.github/workflows/publish-to-test-pypi.yml actions
  • actions/checkout master composite
  • actions/setup-python v1 composite
  • pypa/gh-action-pypi-publish master composite
  • svenstaro/upload-release-action v2 composite
entsoe/geo/requirements.txt pypi
  • geojson-rewind *
  • geopandas *
  • plotly *
requirements.txt pypi
  • beautifulsoup4 >=4.11.1
  • pandas >=2.2.0
  • pytz *
  • requests *
setup.py pypi
  • beautifulsoup4 >=4.11.1
  • pandas >=2.2.0
  • pytz *
  • requests *