skillfed

pycountry

ISO country, subdivision, language, currency and script definitions and their translations

pycountry Copyleft license LGPL-2.1-only Active 967 v26.2.16 released

Install

pycountry on PyPI

pip

pip install pycountry

uv

uv add pycountry

poetry

poetry add pycountry

Package 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: InternationalizationTopic :: Software Development :: Localization

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>_ Languages
  • 3166 <https://en.wikipedia.org/wiki/ISO_3166>_ Codes for representation of names of countries and their subdivisions
  • 3166-1 <https://en.wikipedia.org/wiki/ISO_3166-1>_ Countries
  • 3166-3 <https://en.wikipedia.org/wiki/ISO_3166-3>_ Deleted countries
  • 3166-2 <https://en.wikipedia.org/wiki/ISO_3166-2>_ Subdivisions of countries
  • 4217 <https://en.wikipedia.org/wiki/ISO_4217>_ Currencies
  • 15924 <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...

Read as markdown · JSON record · Source repository

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
iso country codes lookuplanguage currency script databaseiso 3166 subdivision searchcountry data python libraryfuzzy country name matchingiso standard definitionsmultilingual country metadata

Similar packages