ENTSO-E Connection
ENTSO-E Node
- class eta_nexus.nodes.EntsoeNode(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Node for the EntsoE API
Available endpoint Endpoint
Description
ActualGenerationPerType
Actual Generation Per Energy Type
Price
Price day ahead
Currently, there is only two endpoints available, due to the parameter managing required by the API documentation. The other possible endpoints are listed in
eta_nexus.connections.entso_e._ConnectionConfiguration._doc_types
Main bidding zone Bidding Zone
Description
DEU-LUX
Deutschland-Luxemburg
The other possible bidding zones are listed in
eta_nexus.connections.entso_e._ConnectionConfiguration._bidding_zones
- endpoint: str
REST endpoint.
- bidding_zone: str
Bidding zone.
- connection_identifier() str
Unique identifier for the connection that is associated with the node (i.e. would be created by Connection.from_node())
- name: str
Name for the node.
- url: str
URL of the connection.
- url_parsed: ParseResult
Parse result object of the URL (in case more post-processing is required).
- dtype: Callable | None
Data type of the node (for value conversion). Note that strings will be interpreted as utf-8 encoded. If you do not want this behaviour, use ‘bytes’.
ENTSO-E Connection
- class eta_nexus.connections.EntsoeConnection(url: str = 'https://web-api.tp.entsoe.eu', *, nodes: Nodes[EntsoeNode] | None = None, retry_total: int = 3, retry_backoff_factor: float = 1.0)[source]
ENTSOEConnection is a class to download and upload multiple features from and to the ENTSO-E transparency platform database as timeseries. The platform contains data about the european electricity markets.
- Parameters:
url – Url of the server with scheme (https://web-api.tp.entsoe.eu/)
usr – Username for login to the platform (usually not required - default: None)
pwd – Password for login to the platform (usually not required - default: None)
nodes – Nodes to select in connection
retry_total – Total number of retries for failed HTTP requests (default: 3).
retry_backoff_factor – Backoff factor for retries (default: 1s-> e.g. 1s, 2s, 4s for 3 retries).
- API_PATH: str = 'api'
- logger: Logger = <Logger eta_nexus.connections.entsoe_connection (WARNING)>
- read_series(from_time: datetime, to_time: datetime, nodes: EntsoeNode | Nodes[EntsoeNode] | None = None, interval: TimeStep = 1, **kwargs: Any) pd.DataFrame[source]
Download timeseries data from the ENTSO-E Database.
- Parameters:
nodes – Single node or list/set of nodes to read values from
from_time – Starting time to begin reading (included in output)
to_time – Time to stop reading at (not included in output)
interval – interval between time steps. It is interpreted as seconds if given as integer.
- Returns:
Pandas DataFrame containing the data read from the connection
- read_node(node: N, from_time: datetime, to_time: datetime, interval: timedelta, **kwargs: Any) pd.DataFrame[source]
Read data from a REST API endpoint.
- Parameters:
node – Node to read data from.
from_time – Start of the time series (timezone-aware).
to_time – End of the time series (timezone-aware).
interval – Time interval between data points.
kwargs – Additional arguments.
- Returns:
DataFrame containing the data read from the API.
- url_parsed: ParseResult
URL of the server to connect to
- exc: BaseException | None
Example Usage
An example using the ENTSO-E connection:
# Define your ENTSO-E Token in a .env file
# Check out EntsoeNode documentation for endpoint and bidding zone information
node = EntsoeNode(
"CH1.Elek_U.L1-N",
"https://web-api.tp.entsoe.eu/",
"entsoe",
endpoint="Price",
bidding_zone="DEU-LUX",
)
# start connection from one or multiple nodes
server = EntsoeConnection.from_node(node)
# Define time interval as datetime values
from_datetime = datetime.strptime("2022-02-15T13:18:12", "%Y-%m-%dT%H:%M:%S")
to_datetime = datetime.strptime("2022-02-15T14:00:00", "%Y-%m-%dT%H:%M:%S")
# read_series will request data from specified connection and time interval
# The DataFrame will have index with time delta of the specified interval in seconds
if isinstance(server, EntsoeConnection):
result = server.read_series(from_time=from_datetime, to_time=to_datetime, interval=1)
else:
raise TypeError("The connection must be an ENTSOEConnection, to be able to call read_series.")