This release is a pre-release and may not be stable for production use.
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. Country records include the
international dial code when available. Fuzzy text lookup tables include a
similarity percentage for each result. Fuzzy matching uses Python's built-in
difflib.SequenceMatcher.
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.0rc4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| countrycodes_cli-0.1.0rc4.tar.gz | 4.5 kB | Without provenance | Details for countrycodes_cli-0.1.0rc4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| countrycodes_cli-0.1.0rc4-py3-none-any.whl | Python 3 | none | any | Details for countrycodes_cli-0.1.0rc4-py3-none-any.whl |
Total release size: 10.2 kB
Release files / countrycodes_cli-0.1.0rc4.tar.gz
| Download URL | countrycodes_cli-0.1.0rc4.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18a2dddc45c140d3e2134edadcb1ac329725847b0ec27396c8565e2bf0f4d0c4
|
|
BLAKE2b-256 checksum How to use checksums |
9f2c249f6a7865a5ea9a4a41611fa22781ce797e854dd988e90f1921010430c0
|
| 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.0rc4-py3-none-any.whl
| Download URL | countrycodes_cli-0.1.0rc4-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d377c20d102993beeb397e8af45446ce814151af78095fab609a564460b4cb61
|
|
BLAKE2b-256 checksum How to use checksums |
430da895ad367139f65c6842e87978c6a30b74ecee410d9496777016200882ca
|
| 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.0rc4
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.