pycountry
ISO country, subdivision, language, currency and script definitions and their translations
Install
pycountry on PyPI
pip
pip install pycountryuv
uv add pycountrypoetry
poetry add pycountryPackage facts
| License | LGPL-2.1-only (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 177 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pycountry-26.2.16-py3-none-any.whl
Keywords: country, subdivision, language, currency, iso, 3166, 639, 4217, 15924, 3166-1, 3166-2, 3166-3
About pycountry
from the package's own PyPI description — quoted content, verbatim
pycountry
pycountry provides the ISO databases for the standards:
639-3 <https://en.wikipedia.org/wiki/ISO_639-3>_ Languages3166 <https://en.wikipedia.org/wiki/ISO_3166>_ Codes for representation of names of countries and their subdivisions3166-1 <https://en.wikipedia.org/wiki/ISO_3166-1>_ Countries3166-3 <https://en.wikipedia.org/wiki/ISO_3166-3>_ Deleted countries3166-2 <https://en.wikipedia.org/wiki/ISO_3166-2>_ Subdivisions of countries4217 <https://en.wikipedia.org/wiki/ISO_4217>_ Currencies15924 <https://en.wikipedia.org/wiki/ISO_15924>_ Scripts
The package includes a copy from Debian's pkg-isocodes
<https://salsa.debian.org/iso-codes-team/iso-codes>_ and makes the data
accessible through a Python API.
Translation files for the various strings are included as well.
Data update policy
No changes to the data will be accepted into pycountry. This is a pure
wrapper around the ISO standard using the pkg-isocodes database from
Debian as is. If you need changes to the political situation in the
world, please talk to the ISO or Debian people, not...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
pycountry provides Python access to ISO standard databases for countries, subdivisions, languages, currencies, and scripts, bundling Debian's pkg-isocodes data with a query API that supports exact lookups and fuzzy search.
Installation is straightforward with no runtime dependencies and a pure-Python wheel distribution. The package is actively maintained with recent releases and a healthy repository (967 stars), last commit on 2026-08-10.
pycountry is licensed under LGPL-2.1-only (copyleft), which requires that any modifications to the library itself be shared under the same license, though applications using it as a dependency are not affected by this restriction.
Usage
import pycountry
# Look up a country by ISO 3166-1 alpha-2 code
germany = pycountry.countries.get(alpha_2='DE')
print(germany.name) # 'Germany'
# Fuzzy search for countries
results = pycountry.countries.search_fuzzy('England')
print(results[0].name) # 'United Kingdom'
Requires Python 3.10 or later (supports 3.10–3.14).
Verdict: pycountry is a stable, well-maintained reference library for ISO standard data with zero dependencies and no known vulnerabilities. Its copyleft license is permissive for most use cases. Recommended for applications needing authoritative country, language, currency, or script metadata with fuzzy-search capability.
Needs verification
- Whether the bundled pkg-isocodes data is updated regularly and how lag time compares to upstream ISO standards
- Performance characteristics for large-scale fuzzy searches across all 5046+ subdivisions
- Whether translation files for non-English locales are complete and actively maintained
Similar packages
permissive · top 1,000 on PyPI
holidayspermissive · top 1,000 on PyPI
phonenumberspermissive · top 1,000 on PyPI
regexpermissive · top 100 on PyPI
daffpermissive · top 1,000 on PyPI
supabasepermissive · top 1,000 on PyPI
Unidecodecopyleft · top 1,000 on PyPI
isodatepermissive · top 1,000 on PyPI
postgrestpermissive · top 1,000 on PyPI
youtube-transcript-apipermissive · top 1,000 on PyPI