energy_data_retrieval.sources.global_solar_atlas.client#

Download pinned 2019 GSA archives, retaining annual GHI and its metadata.

class energy_data_retrieval.sources.global_solar_atlas.client.SolarAtlasTransport(inner, *, country='Spain')[source]#

Bases: BaseTransport

Follow exactly one provider-issued download redirect to its known S3 object.

The surrounding HTTPClient handles byte limits, retries, hashes and atomic files. Its durable record always contains the public API URL. Signed URLs are used only in memory, never returned or stored. No arbitrary redirect destination is accepted; only the selected, pinned country archive is allowed.

Parameters:
  • inner (httpx.BaseTransport)

  • country (str)

handle_request(request)[source]#

Return the public response or its validated single-object download.

Parameters:

request (Request)

Return type:

Response

close()[source]#
Return type:

None

class energy_data_retrieval.sources.global_solar_atlas.client.GlobalSolarAtlasClient(http)[source]#

Bases: object

Use SolarAtlasTransport and a limit of 110 MB (Spain) or 160 MB (Chile).

Parameters:

http (HTTPClient)

download_spain_ghi(directory)[source]#
Parameters:

directory (Path)

Return type:

tuple[Path, RequestRecord]

download_chile_ghi(directory)[source]#

Annual 1999-2018 GHI; source coverage ends at 45 degrees south.

Parameters:

directory (Path)

Return type:

tuple[Path, RequestRecord]