Load alternative country names used by countryname.
def load_countryname_dict(
as_type: Literal["dict", "pandas", "polars"] = "dict"
)
Description
The dataset pairs standardized English country names with alternative names drawn from many languages and sources.
Arguments
as_type | Output representation: "dict", "pandas", or "polars". |
Value
The alternative-name dictionary in the requested representation.
Raises
ValueError | If as_type is invalid. |
ImportError | If the requested optional DataFrame library is absent. |
Examples
names = load_countryname_dict()
set(names) == {"country.name.en", "country.name.alt"}