sentier_peakachu.utils_location#

Module Contents#

Functions#

get_geonames_iri_from_iso_code(...)

Lookup the geoname identifier for a given ISO code using a CSV lookup table.

Attributes#

sentier_peakachu.utils_location.get_geonames_iri_from_iso_code(iso_code: str) sentier_data_tools.GeonamesIRI[source]#

Lookup the geoname identifier for a given ISO code using a CSV lookup table.

Parameters:

iso_code (str) – The ISO country code. It can be either a two-digit ISO 3166-1 alpha-2 code or a three-digit ISO 3166-1 alpha-3 code.

Returns:

The IRI of the location identifier.

Return type:

GeonamesIRI

Raises:

ValueError – If the iso_code is not two or three characters long or if no matching geoname identifier is found.

sentier_peakachu.utils_location.BASE_URL = 'https://sws.geonames.org/'[source]#
sentier_peakachu.utils_location.LOOKUP_FILE = '../data/iso_iri_table.csv'[source]#
sentier_peakachu.utils_location.LOOKUP_SEPARATOR = '\t'[source]#