from spotforecast2_safe.downloader.entsoe import download_day_ahead_price
download_day_ahead_price(api_key="YOUR_API_KEY", country_code="DE_LU", force=True)downloader.entsoe.download_day_ahead_price
downloader.entsoe.download_day_ahead_price(
api_key,
country_code='DE_LU',
start=None,
end=None,
force=False,
timeout=60.0,
)Download the ENTSO-E day-ahead spot price (DE/LU).
Queries query_day_ahead_prices and merges the result into interim/day_ahead_price.csv (column "Day-ahead Price"). The day-ahead auction price is leakage-clean (published D-1); the realised price must not be used. Consumed downstream by spotforecast2_safe.preprocessing.exog_providers.EntsoeDayAheadPriceProvider via spotforecast2_safe.data.fetch_data.load_day_ahead_price.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| api_key | str | ENTSO-E Web API security token. | required |
| country_code | str | Bidding-zone code. Defaults to "DE_LU". |
'DE_LU' |
| start | Optional[str] | Start in 'YYYYMMDDHH00' format, or None to default to seven days ago. |
None |
| end | Optional[str] | End in 'YYYYMMDDHH00' format, or None to default to the start of tomorrow. |
None |
| force | bool | If True, bypass the small-window cooldown check. | False |
| timeout | Optional[float] | Per-socket-operation read timeout in seconds. None disables the timeout. Defaults to 60.0. |
60.0 |
Raises
| Name | Type | Description |
|---|---|---|
| ImportError | If entsoe-py is not installed. |
|
| ValueError | If start or end cannot be parsed. |
|
| RuntimeError | If the download fails after _MAX_RETRIES attempts. |