eta_nexus.connections.smard_connection module
- class eta_nexus.connections.smard_connection.SmardConnection(url: str = 'https://smard.api.proxy.bund.dev/app', *, nodes: Nodes[SmardNode] | None = None)[source]
Bases:
RESTConnection[SmardNode],StatusReadable[SmardNode],SeriesReadable[SmardNode]Connection to SMARD (Bundesnetzagentur Strommarktdaten) API.
Provides access to German electricity market data including power generation by source, consumption, market prices, and generation forecasts. No authentication required.
- Parameters:
url – Base URL (default: https://smard.api.proxy.bund.dev/app)
nodes – Nodes to select in connection
For detailed documentation including available filters, regions, time resolutions, and usage examples, see SMARD Connection.
- logger: Logger = <Logger eta_nexus.connections.smard_connection (WARNING)>
- read(nodes: SmardNode | Nodes[SmardNode] | None = None) pd.DataFrame[source]
Read the latest available values from SMARD.
Fetches the most recent data chunk for each node and returns the last available data point. Note that SMARD data has publication delay, so the “latest” value may be hours or days old depending on data type.
- Parameters:
nodes – Single node or list/set of nodes to read values from.
- Returns:
pandas.DataFrame containing the latest available values.
- read_node(node: SmardNode, from_time: datetime, to_time: datetime, interval: timedelta, **kwargs: Any) pd.DataFrame[source]
Read data for a single SMARD node.
Due to SMARD API design, we need to: 1. Get available timestamps from index endpoint 2. Find appropriate starting timestamp for our time range 3. Request time series data from that timestamp
- Parameters:
node – Node to read from
from_time – Start of the time series (timezone-aware).
to_time – End of the time series (timezone-aware).
interval – Time interval for resampling (currently unused, data returned at native resolution).
kwargs – Additional arguments (currently unused).
- Returns:
DataFrame with node data