energy_data_retrieval.sources.ree.client#

Actual system energy from the REData generation-structure widget.

This is aggregate generation by technology, not individual plant telemetry. The widget’s API energy values are MWh, even when the website scales its chart to GWh. Source offset-bearing period labels and last-update metadata are retained. No demand, installed capacity or forecast is substituted for generation.

class energy_data_retrieval.sources.ree.client.REEGeneration(frame, requests)[source]#

Bases: object

Normalized observations and non-secret provenance for every response.

Parameters:
frame: DataFrame#
requests: tuple[RequestRecord, ...]#
energy_data_retrieval.sources.ree.client.normalize_generation(payload, *, area='national', time_trunc='day', include_total=False, maximum_rows=1000000)[source]#

Parse one estructura-generacion JSON response into long MWh rows.

timestamp is the source period-start label converted to UTC. period and source_datetime preserve the provider’s civil date and offset. A daily, monthly or yearly energy value is never treated as instantaneous MW. Null observations remain NaN; reported zeros and negative values remain. The source’s total series is excluded by default to prevent double counting. Empty included means no observations, without inferring zero generation.

Parameters:
  • payload (JSONValue)

  • area (str)

  • time_trunc (str)

  • include_total (bool)

  • maximum_rows (int)

Return type:

DataFrame

class energy_data_retrieval.sources.ree.client.REEClient(http, maximum_requests=32, maximum_rows=1000000)[source]#

Bases: object

Unauthenticated REData access with bounded calendar-year request chunks.

Parameters:
  • http (HTTPClient)

  • maximum_requests (int)

  • maximum_rows (int)

http: HTTPClient#
maximum_requests: int#
maximum_rows: int#
generation(start, end, *, time_trunc='day', system='national', geo_id=None, include_total=False)[source]#

Retrieve inclusive provider civil dates, preserving MWh and period labels.

Use system='ccaa', geo_id='7' for an explicit autonomous-community identifier from REE’s catalogue. National uses the widget’s documented default; named island/peninsular systems send all three geo parameters. Monthly and yearly queries must cover complete calendar periods. No completeness claim is made for provider omissions or provisional data.

Parameters:
  • start (date)

  • end (date)

  • time_trunc (str)

  • system (str)

  • geo_id (str | None)

  • include_total (bool)

Return type:

REEGeneration