--- id: iso3166 version: "2.1.1" license: MIT license_treatment: permissive maintenance: dormant --- # iso3166 — Self-contained ISO 3166-1 country definitions. License: permissive · Maintenance: dormant · Downloads: 5.5M/mo ## What it is and what it does iso3166 is a self-contained lookup module for ISO 3166-1 country codes and names. It maintains a static dataset of all recognized countries and territories, allowing you to retrieve country information by alpha-2 code (e.g., 'US'), alpha-3 code (e.g., 'USA'), numeric code (e.g., '840'), or country name. The package provides both direct lookups via a countries object and indexed dictionaries for reverse lookups by name, alpha-2, alpha-3, or numeric code. The module has no external dependencies and supports Python 3.6 and later. It includes type hints throughout the codebase and is marked Production/Stable. Updates reflect official ISO changes when they occur—for example, recent releases updated country names like Turkey to Türkiye and Macedonia to North Macedonia. The data is frozen at release time, so the package is best suited for applications that can tolerate a lag between official ISO updates and package releases. Use it for: - Validate or normalize user-supplied country codes in web forms or APIs. - Convert between different country code formats (e.g., from user input to a standard format for storage). - Populate dropdown lists or reference data in applications that need to display all recognized countries. - Enrich datasets by looking up country names from numeric or alphabetic codes. - Build geolocation or localization features that need to map country codes to display names. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts between ISO 3166-1 country codes (two-letter, three-letter, and numeric) and country names, with lookup by any code format or iteration over all defined countries. Yes. The package is lightweight, has no dependencies, and solves a straightforward problem with a stable, well-tested API. Dormant maintenance is not a concern for a data-reference module that changes only when ISO standards change. Use it when you need reliable ISO 3166-1 lookups without external API calls or heavy dependencies. ## Install pip install iso3166 uv add iso3166 poetry add iso3166 ## Installing iso3166 Before you install: Low friction install with no runtime dependencies. Maintenance is dormant—last release was in July 2022—but the package is marked Production/Stable and the repository remains active, suggesting it is feature-complete rather than abandoned. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install iso3166 from iso3166 import countries country = countries.get('us') print(country.name, country.alpha2, country.alpha3, country.numeric) Verify before relying: - Whether the country data is kept current with official ISO 3166-1 updates given the dormant maintenance status. - Performance characteristics when iterating over all countries or performing bulk lookups. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 5.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags iso 3166 country codes, country code lookup, alpha2 alpha3 numeric conversion, country name to code, iso country definitions, country-codes, iso-standards, reference-data [View on SkillFed](https://skillfed.io/packages/iso3166) · [View on PyPI](https://pypi.org/project/iso3166/)