:py:mod:`sentier_peakachu.utils_location` ========================================= .. py:module:: sentier_peakachu.utils_location Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: sentier_peakachu.utils_location.get_geonames_iri_from_iso_code Attributes ~~~~~~~~~~ .. autoapisummary:: sentier_peakachu.utils_location.BASE_URL sentier_peakachu.utils_location.LOOKUP_FILE sentier_peakachu.utils_location.LOOKUP_SEPARATOR .. py:function:: get_geonames_iri_from_iso_code(iso_code: str) -> sentier_data_tools.GeonamesIRI Lookup the geoname identifier for a given ISO code using a CSV lookup table. :param iso_code: 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. :type iso_code: str :returns: The IRI of the location identifier. :rtype: GeonamesIRI :raises ValueError: If the `iso_code` is not two or three characters long or if no matching geoname identifier is found. .. py:data:: BASE_URL :value: 'https://sws.geonames.org/' .. py:data:: LOOKUP_FILE :value: '../data/iso_iri_table.csv' .. py:data:: LOOKUP_SEPARATOR :value: '\t'