countries()

Faker.countries()

Return the sorted list of countries available for address generation.

Returns:

list[dict] – Each item has "country_code" (ISO alpha-2, e.g. "US") and "country_name" (e.g. "United States"), sorted alphabetically by country name.

Example:

faker = Faker()
for c in faker.countries():
    print(c["country_code"], c["country_name"])