Skip to main content

Maps from two or three letter country codes to short names

Project description

PyPI npm

This package helps turning two or three letter codes into short English names.

shortcountrynames is maintained by Robert Gieseke (rob.g@web.de).

CSV file

CSV file, with two and three-letter country codes and short English country names based on the country-codes Data Package with some changes and additions to the choice of short names.

Python module

Install with

pip install shortcountrynames

Usage

from shortcountrynames import to_name

assert to_name("DE") == "Germany"
assert to_name("DEU") == "Germany"

JavaScript module

Install with

npm install shortcountrynames

Usage

import {names, to_name} from 'shortcountrynames'

// Define custom codes
names["FOO"] = 'Foo'

console.log(to_name("DEU")) // Germany
console.log(to_name("FOO")) // Foo

Notes

Non-standard codes:

EU, EUU - European Union

XK, XKX - Kosovo

Releasing

Run make update-version to update the Python and Node version and create a new tag.

Push to GitHub with

git push origin main --tags

License

CC0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shortcountrynames-0.16.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shortcountrynames-0.16.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file shortcountrynames-0.16.0.tar.gz.

File metadata

  • Download URL: shortcountrynames-0.16.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shortcountrynames-0.16.0.tar.gz
Algorithm Hash digest
SHA256 0457c461938b7ee022030a1283cbf6cce6ec8c2bd4efefc92dfa550eb25014e9
MD5 955a8102d8d887c51f859222357e1a51
BLAKE2b-256 bf59e67237ed1cf05c88407a50bcbd999b559d17beff7d321d365e821dd5ea7b

See more details on using hashes here.

File details

Details for the file shortcountrynames-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: shortcountrynames-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shortcountrynames-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 036057b7f1129dcbdf41f6c07d84c9e30927eb302715969cafb859f35d1539b6
MD5 cf3e27a18acb7bf04c501380cebe1311
BLAKE2b-256 e4b207cebf3ab212fa55215cf166d3b3ae0dcf0ec59fda69991a8e32922794d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page