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.0rc6

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.0rc6
File Size Uploaded Provenance Actions
countrycodes_cli-0.1.0rc6.tar.gz 4.6 kB Without provenance Details for countrycodes_cli-0.1.0rc6.tar.gz

Built distribution (wheel)

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

Total release size: 10.3 kB

Release files / countrycodes_cli-0.1.0rc6.tar.gz

Download URL countrycodes_cli-0.1.0rc6.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3dc25cc04b3995383098e7c0d55dfc6afc8c87654f9a6166687a4b3f1763dc7b
BLAKE2b-256 checksum
How to use checksums
72cc3daa9f8ebd485e7528b75a9d6746e6b6469bb0843d56e14b2ce68018d0a4
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.0rc6-py3-none-any.whl

Download URL countrycodes_cli-0.1.0rc6-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ee1b4a825e075ca83d20a033097acb411139d0bd8cb303229971aa065a9cb95
BLAKE2b-256 checksum
How to use checksums
f740e103a743cd02ab5354a136303fed56f2263fe79b28b3386db269a2ff2292
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.0rc6

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