energy_data_retrieval.sources.natural_earth.client#

Bounded, checksummed acquisition of Natural Earth Admin 0 country contours.

class energy_data_retrieval.sources.natural_earth.client.BoundaryDownload(shapefile, manifest, request)[source]#

Bases: object

Local .shp path, companion files and exact public-source provenance.

Parameters:
shapefile: Path#
manifest: Path#
request: RequestRecord#
class energy_data_retrieval.sources.natural_earth.client.NaturalEarthClient(http)[source]#

Bases: object

Parameters:

http (HTTPClient)

download_countries(directory, *, scale='10m', expected_sha256=None)[source]#

Keep .shp/.shx/.dbf/.prj/.cpg companions and a source/hash manifest.

Scale means 1:10/50/110 million, not metre accuracy. The official URL tracks releases; pass a previously recorded SHA-256 to require identical bytes. Only exact, flat member names are read; archives are never blindly extracted. Compressed size is bounded by the shared HTTP configuration.

Parameters:
  • directory (Path)

  • scale (Literal['10m', '50m', '110m'])

  • expected_sha256 (str | None)

Return type:

BoundaryDownload