energy_data_retrieval.sources.emi.client#

New Zealand EMI plant-associated metered injections, in half-hour kWh.

energy_data_retrieval.sources.emi.client.generation_urls(start, end, *, maximum_requests=24)[source]#

Plan inclusive civil-date retrieval as bounded monthly CSV requests.

Parameters:
  • start (date)

  • end (date)

  • maximum_requests (int)

Return type:

tuple[str, …]

energy_data_retrieval.sources.emi.client.parse_generation_csv(data, *, maximum_rows=2000000)[source]#

Normalize native TP columns to UTC interval-start kWh observations.

EMI maps metered grid injections to plants and sometimes apportions a shared injection point. This is not direct SCADA for every unit. Local trading days have 46, 48 or 50 actual half hours; invalid extra TP values fail rather than shifting subsequent days. Missing intervals remain NaN, never zero.

Parameters:
  • data (bytes | str)

  • maximum_rows (int)

Return type:

DataFrame

class energy_data_retrieval.sources.emi.client.EMIClient(http, *, maximum_requests=24, maximum_rows=2000000)[source]#

Bases: object

Read public monthly exports without credentials; retain each response hash.

Parameters:
  • http (HTTPClient)

  • maximum_requests (int)

  • maximum_rows (int)

generation(start, end, *, plants=None)[source]#

Fetch inclusive New Zealand dates, optionally selecting plant codes.

Parameters:
  • start (date)

  • end (date)

  • plants (Sequence[str] | None)

Return type:

GenerationResult