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.15.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.15.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shortcountrynames-0.15.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.15.0.tar.gz
Algorithm Hash digest
SHA256 28600b778902925245ec23f016b58d7d874322b3939c0d78dd9a9098732bb799
MD5 4fd3587301c72f180d2e4aadb1c4cb53
BLAKE2b-256 dfbb813e3bde1aa5541e51132abbf67e7f7bc10164aebf770dfd019f86a70c3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shortcountrynames-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f70a6920e0bfb9f8dc62ecbb8c89127d5e187c3881fb435f90654265c91cae9
MD5 5fff4fd0cf19b17ee44c471245bf591f
BLAKE2b-256 06c33fc48d3ce01798c62f5725db92960bdaf12fd1c0bb661e550d56a2534d8f

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