pycountry
ISO country, subdivision, language, currency and script definitions and their translations
Decision gist · record as of 2026-08-14
Yes. pycountry is a stable, actively maintained reference library with zero runtime dependencies, no known vulnerabilities, and a clear single purpose: providing read-only access to ISO standard data. Install it when you need to work with country codes, subdivisions, currencies, or languages in a standards-compliant way. The LGPL-2.1 copyleft license is a consideration only if you plan to modify and redistribute the package itself.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Installs with no runtime dependencies and maintains active development; last commit was recent and repository is not archived.
License · maintenance · safety
LGPL-2.1-only (copyleft) — Licensed under LGPL-2.1-only (copyleft), which requires derivative works and modifications to be distributed under the same license if distributed at all.
last release 2026-02-17 (178 days) · last repo commit 2026-08-10 · 967 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 40,171,416 downloads/mo, #685 on PyPI
Alternatives
Verify before relying
import pycountry
# Look up a country by alpha-2 code
germany = pycountry.countries.get(alpha_2='DE')
print(germany.name) # 'Germany'
# Search for countries by fuzzy matching
results = pycountry.countries.search_fuzzy('England')
print(results[0].name) # 'United Kingdom'
# Access subdivisions
de_subdivisions = pycountry.subdivisions.get(country_code='DE')
print(len(de_subdivisions)) # 16
# Look up currencies
usd = pycountry.currencies.get(alpha_3='USD')
print(usd.name)- Whether the included pkg-isocodes data is kept current with upstream Debian releases and how frequently updates occur.
- Performance characteristics when iterating over all subdivisions (5046 entries) or performing fuzzy searches on large datasets.
- Whether translation files are complete for all supported languages and which languages are included.
What it is and what it does
pycountry is a wrapper around the ISO standards databases maintained by Debian's pkg-isocodes project. It exposes ISO 639-3 (languages), ISO 3166-1 (countries), ISO 3166-2 (subdivisions), ISO 3166-3 (historic countries), ISO 4217 (currencies), and ISO 15924 (scripts) as queryable Python objects with no external runtime dependencies.
The package is designed as a read-only reference layer: it does not accept data modifications and explicitly defers all requests for political or standard changes to the ISO organization or Debian maintainers. You can look up countries by alpha-2, alpha-3, or numeric codes; search subdivisions by code or country; and perform fuzzy searches with unicode normalization to handle misspellings and accent variations. Subdivision objects include parent-child relationships and type information.
Use it for
- Validate and normalize country codes in web forms or APIs before storing or processing geographic data.
- Build dropdown menus or autocomplete fields that map user input to ISO country or currency codes.
- Retrieve official country names, flags, and subdivision hierarchies for display in multi-language applications.
- Translate between different country code formats (alpha-2, alpha-3, numeric) in data pipelines.
- Implement geographic filtering or routing logic that requires looking up subdivisions by country code.
- Populate reference data for financial or logistics systems that require ISO 4217 currency or ISO 3166 country definitions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pycountry is a stable, actively maintained reference library with zero runtime dependencies, no known vulnerabilities, and a clear single purpose: providing read-only access to ISO standard data. Install it when you need to work with country codes, subdivisions, currencies, or languages in a standards-compliant way. The LGPL-2.1 copyleft license is a consideration only if you plan to modify and redistribute the package itself.
Install
pycountry on PyPI
Before you install
Installs with no runtime dependencies and maintains active development; last commit was recent and repository is not archived.
Requires Python 3.10 or later.
License in practice
Licensed under LGPL-2.1-only (copyleft), which requires derivative works and modifications to be distributed under the same license if distributed at all.
Quickstart
import pycountry
# Look up a country by alpha-2 code
germany = pycountry.countries.get(alpha_2='DE')
print(germany.name) # 'Germany'
# Search for countries by fuzzy matching
results = pycountry.countries.search_fuzzy('England')
print(results[0].name) # 'United Kingdom'
# Access subdivisions
de_subdivisions = pycountry.subdivisions.get(country_code='DE')
print(len(de_subdivisions)) # 16
# Look up currencies
usd = pycountry.currencies.get(alpha_3='USD')
print(usd.name)
Verify before relying
- Whether the included pkg-isocodes data is kept current with upstream Debian releases and how frequently updates occur.
- Performance characteristics when iterating over all subdivisions (5046 entries) or performing fuzzy searches on large datasets.
- Whether translation files are complete for all supported languages and which languages are included.
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 178 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 40,171,416 / month, #685 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | 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 |
Evidence: pycountry-26.2.16-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “language currency script database”
- pycountryProvides programmatic access to ISO standard databases for countries,…
- ccyProvides a dictionary of currency objects with financial metadata,…
- isocodesisocodes provides programmatic access to ISO standard reference data…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internationalization packages
Measures the displayed width of Unicode strings in terminals, accounting for wide characters, combining marks, and terminal escape sequences that standard Python string functions mishandle.
Install it if your application formats text for terminals and handles non-ASCII characters.
Babel provides internationalization (i18n) and localization (l10n) utilities for Python applications, handling date/time formatting, number localization, message translation, and timezone operations across different languages and locales.
Install it if your application needs to support multiple languages or locales.
Converts numbers to their word representations in multiple languages, supporting cardinal numbers, ordinals, years, and currency formats.
Install it if you need multilingual number-to-words conversion.
polib reads, writes, and manipulates gettext translation files (PO, POT, and MO formats), allowing you to load, iterate, modify entries, and create translation catalogs programmatically.
Install it if you need to work with gettext files programmatically.
Provides Unicode normalization (NFC, NFD, NFKC, NFKD) using Unicode Standard version 17.0 data, independent of the host Python environment's built-in Unicode version.
Install it if your application requires consistent normalization across different systems or if you need to target a specific Unicode Standard version.
Converts dates between the Hijri (Islamic) and Gregorian calendars using the Umm al-Qura standard, with support for dates from 1343 AH to 1500 AH.
Install it if you need reliable Hijri-Gregorian conversion within the supported date range; the main constraint is the 1343–1500 AH window and the explicit…
See also ccy · country-converter · country_list · countryinfo · isocodes · pycountry-convert · hdx-python-country · iso3166 · babelfish · geonamescache