entsoe-py

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

https://github.com/energieid/entsoe-py

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
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.4%) to scientific vocabulary

Keywords from Contributors

energy-system-model
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: EnergieID
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 1.91 MB
Statistics
  • Stars: 559
  • Watchers: 34
  • Forks: 229
  • Open Issues: 27
  • Releases: 44
Created over 8 years ago · Last pushed 6 months 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 for the REST API: - 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.queryaggregatedbids(countrycode, start, end, processtype) 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.querycontractedreservepricesprocuredcapacity(countrycode, start, end, processtype typemarketagreementtype, psrtype=None) client.querycontractedreserveamount(countrycode, start, end, typemarketagreementtype, psrtype=None) client.queryprocuredbalancingcapacity(countrycode, start, end, processtype, typemarketagreementtype=None) client.queryaggregatewaterreservoirsandhydrostorage(countrycode, start, end) client.queryactivatedbalancingenergyprices(countrycode, start, end, processtype='A16', psrtype=None, businesstype=None, standardmarketproduct=None, originalmarketproduct=None) client.queryactivatedbalancingenergy(countrycode, start, end, businesstype, psr_type=None)

methods that return ZIP (bytes)

client.queryimbalanceprices(countrycode, start, end, psrtype=None) client.queryimbalancevolumes(countrycode, start=start, end=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.queryunavailabilityofoffshoregrid(areacode, start, end) client.querywithdrawnunavailabilityofgenerationunits(country_code, 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.queryaggregatedbids(countrycode, start=start, end=end, processtype) 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.queryactivatedbalancingenergyprices(countrycode, start=start, end=end, processtype='A16', psrtype=None, businesstype=None, standardmarketproduct=None, originalmarketproduct=None) client.queryactivatedbalancingenergy(countrycode, start=start, end=end, businesstype, psrtype=None) client.queryimbalanceprices(countrycode, start=start, end=end, psrtype=None) client.queryimbalancevolumes(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.queryunavailabilityofoffshoregrid(areacode, start, end) client.queryphysicalcrossborderallborders(countrycode, start, end, export=True) client.queryimport(countrycode, start, end) client.querygenerationimport(countrycode, start, end) client.queryprocuredbalancingcapacity(countrycode, processtype, start=start, end=end, typemarketagreement_type=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')

Download from ENTSOE File Library

To download from the file libary, which replaced the old SFTP use the files subpackage with the EntsoeFileClient

```python from entsoe.files import EntsoeFileClient

client = EntsoeFileClient(username=, pwd=)

this returns a dict of {filename: unique_id}:

filelist = client.listfolder('AcceptedAggregatedOffers_17.1.D')

either download one file by name:

df = client.downloadsinglefile(folder='AcceptedAggregatedOffers17.1.D', filename=list(filelist.keys())[0])

or download multiple by unique_id:

df = client.downloadmultiplefiles(['a1a82b3f-c453-4181-8d20-ad39c948d4b0', '64e47e15-bac6-4212-b2dd-9667bdf33b5d']) ```

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 |

Environment variables

| Variables | Description | | -- | -- | | ENTSOEENDPOINTURL | Override the default ENTSO-E API endpoint URL. |

Owner

  • Name: EnergieID cvba-so
  • Login: EnergieID
  • Kind: organization
  • Location: Antwerp, Belgium

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
  • Create event: 11
  • Release event: 10
  • Issues event: 85
  • Watch event: 114
  • Issue comment event: 141
  • Push event: 26
  • Pull request review event: 2
  • Pull request event: 32
  • Fork event: 37
Last Year
  • Create event: 11
  • Release event: 10
  • Issues event: 86
  • Watch event: 114
  • Issue comment event: 141
  • Push event: 26
  • Pull request review event: 2
  • Pull request event: 32
  • Fork event: 37

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 335
  • Total Committers: 67
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.725
Past Year
  • Commits: 37
  • Committers: 10
  • Avg Commits per committer: 3.7
  • Development Distribution Score (DDS): 0.378
Top Committers
Name Email Commits
Jan Pecinovsky j****y@g****m 92
Frank Boerman f****k@f****l 90
Johan Paduart j****t@g****m 16
Gopakumar Mohandas g****r@P****U 9
Alexander Warsewa 3****a 8
Piotr Pocheć p****c@i****l 6
shatteringlass f****o@g****m 5
Li Chuang 1****t 5
Philipp Reuber p****r@f****e 5
Jean-Michel Reghem 2****h 5
Frank Boerman f****n@t****u 5
enrico.tesio e****o@d****m 5
Lars Tellemann Sæther l****r@a****o 4
maurerle f****r@o****e 4
Fabio Genoese f****e@g****m 3
drieshugaerts d****s@s****e 3
shuvo-cefalo m****s@c****m 3
jdtrebbien j****n@g****m 3
Vartan Ahrens Kayayan 3****n 3
jm-sm 4****m 3
Lemuel Lee l****e@l****k 2
waldemarmeier w****r@y****e 2
leostimpfle l****e@i****m 2
Paul p****o@n****m 2
Lukas Pirl g****t@l****e 2
Jiro Matsuzawa j****a@n****m 2
Jarrad Whitaker 1****g 2
Hans Böhm b****n 2
Francesc Ortiz f****z@f****m 2
Christophe C****e@o****m 2
and 37 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 291
  • Total pull requests: 151
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 226
  • Total pull request authors: 88
  • Average comments per issue: 2.67
  • Average comments per pull request: 1.55
  • Merged pull requests: 104
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 62
  • Pull requests: 34
  • Average time to close issues: 23 days
  • Average time to close pull requests: 16 days
  • Issue authors: 54
  • Pull request authors: 21
  • Average comments per issue: 1.37
  • Average comments per pull request: 0.62
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fleimgruber (5)
  • ThomasAuriel (5)
  • rablancomo (4)
  • JrtPec (4)
  • AbiAfthab (4)
  • nhlong2701 (3)
  • huertamir (3)
  • ThomasPade (3)
  • PetricaR (3)
  • FabianHofmann (3)
  • AlejandroElBecario (3)
  • mkaut (3)
  • jimich (3)
  • fgenoese (3)
  • Gilles-H (3)
Pull Request Authors
  • jpaduart (9)
  • pee-po (5)
  • maurerle (5)
  • JrtPec (4)
  • awarsewa (4)
  • jdtrebbien (4)
  • fgenoese (4)
  • gmohandas (4)
  • p-reuber (3)
  • ivandjuraki (2)
  • Tijoxa (2)
  • larstellemannsaether-aenergi (2)
  • bryszard (2)
  • quintinnicolas (2)
  • leostimpfle (2)
Top Labels
Issue Labels
more info needed (18) bug (11) help wanted (9) enhancement (6) question (4) server bug (3) wontfix (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 217,643 last-month
  • Total dependent packages: 9
    (may contain duplicates)
  • Total dependent repositories: 28
    (may contain duplicates)
  • Total versions: 92
  • Total maintainers: 2
pypi.org: entsoe-py

A python API wrapper for ENTSO-E

  • Versions: 83
  • Dependent Packages: 8
  • Dependent Repositories: 26
  • Downloads: 217,643 Last month
Rankings
Dependent packages count: 1.1%
Downloads: 1.6%
Average: 2.6%
Dependent repos count: 2.9%
Stargazers count: 3.5%
Forks count: 4.0%
Maintainers (2)
Last synced: 6 months ago
conda-forge.org: entsoe-py
  • Versions: 9
  • Dependent Packages: 1
  • Dependent Repositories: 2
Rankings
Forks count: 15.7%
Dependent repos count: 20.1%
Average: 22.0%
Stargazers count: 23.3%
Dependent packages count: 29.0%
Last synced: 6 months ago

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 2.2.1 composite
entsoe/geo/requirements.txt pypi
  • geojson-rewind *
  • geopandas *
  • plotly *
requirements.txt pypi
  • beautifulsoup4 *
  • pandas >=1.4.0
  • pytz *
  • requests *
setup.py pypi
  • beautifulsoup4 *
  • pandas >=1.4.0
  • pytz *
  • requests *