pycountry-convert
Extension of Python package pycountry providing conversion functions.
What it is and what it does
pycountry-convert is an extension of the pycountry library that adds bidirectional conversion functions between country names, ISO country codes (alpha-2, alpha-3, and numeric formats), and continent codes. It uses country data derived from Wikipedia combined with pycountry's data source.
The package provides functions to map countries with customizable name formatting (default, lowercase, or uppercase), convert between any pair of country identifiers, and look up continent codes from country codes. It has no runtime dependencies beyond pycountry and pprintpp, making it lightweight to install.
Use it for:
- Convert user-submitted country names to standardized ISO codes for database storage or API calls.
- Determine a continent from a country code in geographic or regional analysis workflows.
- Build lookup tables mapping country names to their ISO 3166-1 identifiers for data validation.
- Normalize country data from multiple sources by converting between alpha-2, alpha-3, and numeric codes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts between ISO country codes (alpha-2, alpha-3, numeric), country names, and continent codes using data from pycountry and Wikipedia.
No. The package is abandoned (last release 2018-02-18) and has not been tested against modern Python versions. While the MIT license is permissive and installation is frictionless, the lack of maintenance means country data may be stale and bugs will not be fixed. Consider using an actively maintained alternative or integrating pycountry directly with your own conversion logic.
Install
pycountry-convert on PyPI
pip
pip install pycountry-convertuv
uv add pycountry-convertpoetry
poetry add pycountry-convertInstalling pycountry-convert
Before you install
Installation is straightforward with no compiled dependencies. However, the package has been abandoned since its latest release on 2018-02-18, so maintenance and security patches are not expected.
License in practice
Licensed under MIT (permissive), so you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pycountry-convert
from pycountry_convert import country_alpha2_to_continent_code
continent = country_alpha2_to_continent_code('US')
Verify before relying
- Whether the package's Wikipedia-derived country data is kept current or reflects the state as of the last 2018 release.
- Compatibility with modern Python versions beyond 3.6, given the abandonment status and lack of recent testing.
- Whether country data changes since 2018 affect the accuracy of conversions for current use.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,099 days since the last release |
| First released | |
| Downloads | 484,175/month — #6,405 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycountry_convert-0.7.2-py3-none-any.whl
Keywords: pycountry, conversion, tune
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
iso3166Converts between ISO 3166-1 country codes…
permissive · top 5,000 on PyPI
pycountryProvides programmatic access to ISO standard…
copyleft · top 1,000 on PyPI
country-converterConverts and matches country names across…
copyleft · top 5,000 on PyPI
phone-iso3166Maps international phone numbers and mobile…
permissive · top 15,000 on PyPI
ip3countryLooks up the ISO 3166-1 alpha-2 country code…
permissive · top 5,000 on PyPI
django-countriesProvides a Django model field for storing…
permissive · top 5,000 on PyPI
country_listProvides ISO 3166-1 country codes and names in…
permissive · top 15,000 on PyPI
geonamescacheProvides Python dictionaries of geographic data…
permissive · top 5,000 on PyPI
countryinfoCountryinfo provides a Python interface to…
permissive · top 15,000 on PyPI
hdx-python-countryMaps country and region codes and names,…
permissive · top 15,000 on PyPI