Skip to main content

Python client for the ENTSO-E Transparency Platform API

Project description

python-entsoe

Python client for the ENTSO-E Transparency Platform API.

Typed, namespace-organized access to European electricity market data — load, prices, generation, transmission, and balancing.

pip install python-entsoe

Quick Start

from entsoe import Client
import pandas as pd

client = Client()  # reads ENTSOE_API_KEY from environment

start = pd.Timestamp("2024-06-01", tz="Europe/Paris")
end = pd.Timestamp("2024-06-08", tz="Europe/Paris")

df = client.load.actual(start, end, country="FR")

Every method returns a pandas.DataFrame with a timestamp column (UTC) and a value column.

Authentication

Get a free API key at https://transparency.entsoe.eu/ (register, then request a token via email).

Set it as an environment variable:

export ENTSOE_API_KEY=your-token-here

Or pass it directly:

client = Client(api_key="your-token-here")

API Reference

client.load

Method Description Parameters
actual(start, end, country) Actual total system load country: ISO code (e.g., "FR")
forecast(start, end, country) Day-ahead load forecast country: ISO code
df = client.load.actual(start, end, country="FR")
df = client.load.forecast(start, end, country="FR")

client.prices

Method Description Parameters
day_ahead(start, end, country) Day-ahead market prices (EUR/MWh) country: ISO code
df = client.prices.day_ahead(start, end, country="FR")
# Returns: timestamp, value, currency, price_unit

client.generation

Method Description Parameters
actual(start, end, country, psr_type=None) Actual generation per type psr_type: filter by fuel (optional)
forecast(start, end, country, psr_type=None) Wind & solar forecast psr_type: filter by fuel (optional)
installed_capacity(start, end, country, psr_type=None) Installed capacity per type psr_type: filter by fuel (optional)
per_plant(start, end, country, psr_type=None) Generation per production unit psr_type: filter by fuel (optional)
# All generation types
df = client.generation.actual(start, end, country="FR")

# Solar only
df = client.generation.actual(start, end, country="FR", psr_type="B16")

# Installed capacity
df = client.generation.installed_capacity(start, end, country="FR")

client.transmission

Method Description Parameters
crossborder_flows(start, end, country_from, country_to) Physical cross-border flows Two country codes
scheduled_exchanges(start, end, country_from, country_to) Scheduled commercial exchanges Two country codes
net_transfer_capacity(start, end, country_from, country_to) Day-ahead NTC Two country codes
df = client.transmission.crossborder_flows(
    start, end, country_from="FR", country_to="ES"
)

client.balancing

Method Description Parameters
imbalance_prices(start, end, country) System imbalance prices country: ISO code
imbalance_volumes(start, end, country) System imbalance volumes country: ISO code
df = client.balancing.imbalance_prices(start, end, country="FR")

Country Codes

Use standard ISO codes. Some bidding zones have specific codes:

Code Area
FR France
DE_LU Germany/Luxembourg (bidding zone)
ES Spain
NL Netherlands
BE Belgium
IT Italy
IT_NORTH Italy North
NO_1 .. NO_5 Norway zones
SE_1 .. SE_4 Sweden zones
DK_1, DK_2 Denmark zones

Note: For day-ahead prices and balancing data, use DE_LU instead of DE. See data availability notes for details.

Full list of 60+ supported areas in _mappings.py.

PSR Types (Fuel Types)

Use PSR codes to filter generation by fuel type:

Code Fuel Type
B01 Biomass
B04 Fossil Gas
B05 Fossil Hard coal
B06 Fossil Oil
B10 Hydro Pumped Storage
B11 Hydro Run-of-river
B12 Hydro Water Reservoir
B14 Nuclear
B16 Solar
B18 Wind Offshore
B19 Wind Onshore

Full list in _mappings.py. Human-readable names available via:

from entsoe._mappings import PSR_TYPES
print(PSR_TYPES["B16"])  # "Solar"

Timestamps

All start and end parameters must be timezone-aware pd.Timestamp objects:

# Correct
start = pd.Timestamp("2024-01-01", tz="Europe/Paris")
start = pd.Timestamp("2024-01-01", tz="UTC")

# Wrong — will raise InvalidParameterError
start = pd.Timestamp("2024-01-01")

Returned timestamps are always in UTC.

Features

  • Autocomplete-friendly — type client. and see all domains, then drill into methods
  • Automatic year-splitting — requests spanning more than 1 year are split transparently
  • ZIP handling — endpoints returning compressed responses are decompressed automatically
  • Retry with backoff — rate-limited requests (HTTP 429) are retried with exponential backoff
  • Clear errorsNoDataError, InvalidParameterError, RateLimitError with descriptive messages

Error Handling

from entsoe import Client, NoDataError, InvalidParameterError

client = Client()

try:
    df = client.prices.day_ahead(start, end, country="FR")
except NoDataError:
    print("No data available for this period")
except InvalidParameterError as e:
    print(f"Bad parameters: {e}")

Examples

See the examples/ directory for Jupyter notebooks with plotly visualizations:

Development

git clone https://github.com/jsulopzs/python-entsoe.git
cd python-entsoe
uv sync

# Run tests (requires ENTSOE_API_KEY in .env)
uv run pytest tests/ -v

# Regenerate example notebooks
uv run python scripts/generate_notebooks.py

License

MIT

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

python_entsoe-0.1.1.tar.gz (197.1 kB view details)

Uploaded Source

Built Distribution

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

python_entsoe-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file python_entsoe-0.1.1.tar.gz.

File metadata

  • Download URL: python_entsoe-0.1.1.tar.gz
  • Upload date:
  • Size: 197.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_entsoe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d093c3956fa8c92dde94fe1f2f0f2545ae7b9afd91ca2eadf6d2d2ffcb047a67
MD5 6e47a4dc54e3fe953ac823f043efec00
BLAKE2b-256 b64df9f3f59d8d708659595dfa740252df2476be4b043807f368df6c4c96bacf

See more details on using hashes here.

File details

Details for the file python_entsoe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_entsoe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_entsoe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5c91841148fb27cf12377488bd2b2de06a48f9c225db21ae30a98d2431fa6e
MD5 91e30cd702251ad0e365e670b6dc257e
BLAKE2b-256 a2ca4f8b18368f5c25c1dcadbe1708fb916ff267f75a8bff9d491d30122c1eb8

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