Skip to main content

Module country_code

Module country_code 

Source

Structs§

CountryRegionCode

Constants§

COUNTRY_AND_CODES
List of (alpha-2 code, country name) tuples based on ISO 3166-1 alpha-2.
KNOWN_REGION_NAMES
List of non-country region names that were commented out above.
NON_STANDARD_COUNTRY_CODES
US_STATE_NAMES

Functions§

get_country_code
Gets the alpha-2 country code for a given country name. If the country name is not found in the standard or non-standard maps, it returns the country name as a fallback.
is_known_country_region
Utility function to check if a country name is in the standard list. Match U.S states to United States for consistency.