Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

countrycodes-cli

GitHub PyPI License CI

Command-line interface for the countrycodes ISO 3166-1 lookup library.

Installation

Install as a command-line tool with uv:

uv tool install countrycodes-cli

Or install into the active Python environment:

python -m pip install countrycodes-cli

Requires Python 3.11 or newer. The library dependency is installed automatically.

Usage

Look up a country by code or name:

countrycodes lookup US
countrycodes lookup "United Kingdom"
countrycodes lookup +1
countrycodes lookup Untied --limit 3

Lookups are displayed as a table by default. Choose JSON output or list all countries:

countrycodes lookup GBR --format json
countrycodes list
countrycodes list --format json

The --limit option controls the maximum number of matches shown for a lookup (default: 5), including countries sharing a dial code. When the text output is truncated, the CLI notes that it is showing only the top matches. JSON lookup output is a single record for one match or an array for multiple matches. The default list is rendered as a table sorted by alpha-2 code, with a row number, and JSON list output is an unnumbered array. Text tables show a country's common name when available, falling back to its source name. Country records include the international dial code when available. Fuzzy text lookup tables include a combined word-level and full displayed-name similarity percentage for each result. Fuzzy matching uses transposition-aware edit-distance scoring. Country name data is retained as provided by its source; inclusion does not imply endorsement of any political position.

See all options with:

countrycodes --help

License

The CLI code is licensed under BSD 3-Clause. The separately distributed countrycodes library includes ISO registry data under LGPL-2.1-or-later and continent assignments from GeoNames under CC BY 4.0; installing the CLI installs that library as a dependency.

Metadata

Release files for countrycodes-cli 0.1.0rc5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for countrycodes-cli 0.1.0rc5
File Size Uploaded Provenance Actions
countrycodes_cli-0.1.0rc5.tar.gz 4.6 kB Without provenance Details for countrycodes_cli-0.1.0rc5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for countrycodes-cli 0.1.0rc5
File Interpreter ABI Platform Actions
countrycodes_cli-0.1.0rc5-py3-none-any.whl Python 3 none any Details for countrycodes_cli-0.1.0rc5-py3-none-any.whl

Total release size: 10.5 kB

Release files / countrycodes_cli-0.1.0rc5.tar.gz

Download URL countrycodes_cli-0.1.0rc5.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9f10f9851a925cf8ab2b8e4851a07ec200c04d3d86161d84a1ddf42837c5257
BLAKE2b-256 checksum
How to use checksums
40dceca53bbb4523fb1492795253d8d0168b7339012790f060d49b22bb39e054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / countrycodes_cli-0.1.0rc5-py3-none-any.whl

Download URL countrycodes_cli-0.1.0rc5-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b585574edcabaa40044aecbabcea84b068b78130128d716f220969a1a81adaa4
BLAKE2b-256 checksum
How to use checksums
5e4865811df370c2a4811cf17304ac277e7d552650a846e830344b973b745785
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for countrycodes-cli 0.1.0rc5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page