--- id: countryinfo version: "1.0.1" license: MIT license_treatment: permissive maintenance: active --- # countryinfo — A Python module for returning data about countries, ISO info, and states/provinces within them. License: permissive · Maintenance: active · Downloads: 614.7K/mo ## What it is and what it does Countryinfo is a lightweight, zero-dependency library that wraps a curated dataset of country metadata and exposes it through a simple object-oriented API. You instantiate a CountryInfo object with a country name, ISO code (alpha-2, alpha-3, or numeric), or alternate spelling, then call methods to retrieve specific attributes: capital, population, area, currencies, languages, calling codes, borders, timezones, GeoJSON geometry, and more. The library also supports reverse queries (all countries, filtered searches) and optional extras for fuzzy matching and Pydantic model integration. It is designed for applications that need reliable, structured access to country reference data without external API calls or heavy dependencies. Common use cases include form validation, geographic filtering, localization, and data enrichment pipelines. The API is straightforward and the install footprint is minimal, making it suitable for both CLI tools and embedded library use. Use it for: - Validate and normalize country input in web forms or APIs by accepting multiple identifier formats (names, codes, spellings). - Build geographic filters or dashboards that need to display country metadata like capital, population, or official languages. - Enrich datasets with country-level attributes (currencies, timezones, calling codes) during ETL or data processing workflows. - Generate GeoJSON boundaries for mapping applications or spatial analysis without external geospatial libraries. - Implement country-aware features such as timezone detection, language selection, or regional grouping in multi-region applications. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Countryinfo provides a Python interface to query comprehensive geographic and administrative data for any country, including ISO codes, capitals, currencies, languages, borders, and GeoJSON boundaries. Yes. Countryinfo is a stable, well-maintained library with zero dependencies, permissive licensing, and no known vulnerabilities. It fills a genuine need for reliable country metadata lookup. Install it if you need to work with country codes, geographic data, or reference information in a Python application. ## Install pip install countryinfo uv add countryinfo poetry add countryinfo ## Installing countryinfo Before you install: Low install friction with no runtime dependencies. Active maintenance since 2018, last commit 2026-06-21, and supports current Python versions (3.11–3.14). No known vulnerabilities. License in practice: MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install countryinfo from countryinfo import CountryInfo country = CountryInfo("Singapore") print(country.capital()) # Singapore print(country.iso(2)) # SG print(country.currencies()) # ['SGD'] Verify before relying: - Whether the bundled country dataset is kept current with official ISO and geographic standards - Performance characteristics when querying large numbers of countries or calling methods repeatedly ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 614.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags country data lookup library, ISO country codes, geographic country information, capital cities and currencies, country borders and neighbors, country language and timezone data, GeoJSON country boundaries, country-data, iso-codes, geographic-reference [View on SkillFed](https://skillfed.io/packages/countryinfo) · [View on PyPI](https://pypi.org/project/countryinfo/)