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_typeOutput representation: "dict", "pandas", or "polars".

Value

The alternative-name dictionary in the requested representation.

Raises

ValueErrorIf as_type is invalid.
ImportErrorIf the requested optional DataFrame library is absent.

Examples

names = load_countryname_dict()
set(names) == {"country.name.en", "country.name.alt"}