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

Uploaded Python 3

File details

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

File metadata

  • Download URL: shortcountrynames-0.18.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.18.0.tar.gz
Algorithm Hash digest
SHA256 c95251ad85276279d58a299dc3bfce3238cc55d76037ec42bb944751a2af18b8
MD5 0a3c4473ea613eee04105dd1cb5e8ca2
BLAKE2b-256 f9cc67f59e31376fc3d40f5873d9031ab41a5b271c069135a23e18c26c05952b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shortcountrynames-0.18.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 239897b7dcb0985b33d036ed4a1d4265e7d8cedde57104a979721c64b00e008b
MD5 0af129d8362f93d209a2f997ad3ecd1d
BLAKE2b-256 8de2d3a98b10438a2789e03e4ac5a59a16ef0a8315600803ec4291b75d2349f9

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