energy_data_retrieval.sources.kpx.client#

KPX hourly regional market-participating solar generation, in MWh.

energy_data_retrieval.sources.kpx.client.solar_requests(start, end, *, page_size=1000, maximum_requests=100)[source]#

Plan first pages for inclusive Korean dates, without credentials.

The client follows further pages up to maximum_requests. The plan is not a promise that every date fits one page or that an account has API permission.

Parameters:
  • start (date)

  • end (date)

  • page_size (int)

  • maximum_requests (int)

Return type:

tuple[dict[str, str], …]

energy_data_retrieval.sources.kpx.client.parse_generation(payload, *, maximum_rows=100000)[source]#

Parse one API page, retaining hourly energy and the market date.

KPX trading hours 01..24 label the interval END: hour 01 is 00:00-01:00 Asia/Seoul and hour 24 ends at midnight on the following civil date. API quantities are MWh. Missing values remain NaN; negatives and zero stay. Coverage is participating solar generators and may include coupled ESS.

Parameters:
  • payload (JSONValue)

  • maximum_rows (int)

Return type:

DataFrame

class energy_data_retrieval.sources.kpx.client.KPXClient(http, *, api_key, maximum_requests=100, maximum_rows=100000, page_size=1000)[source]#

Bases: object

Bounded daily queries with complete pagination and secret-safe provenance.

Parameters:
  • http (HTTPClient)

  • api_key (str)

  • maximum_requests (int)

  • maximum_rows (int)

  • page_size (int)

classmethod from_environment(http, *, maximum_requests=100, maximum_rows=100000, page_size=1000)[source]#

Read the decoded service key from KPX_API_KEY; never include it in plans.

Parameters:
  • http (HTTPClient)

  • maximum_requests (int)

  • maximum_rows (int)

  • page_size (int)

Return type:

KPXClient

solar_generation(start, end, *, region=None)[source]#

Retrieve all reported regions before applying an optional exact region name.

Parameters:
  • start (date)

  • end (date)

  • region (str | None)

Return type:

GenerationResult