Skip to main content

Maps from two or three letter country codes to short names

Project description

“Do One Thing and Do It Well” - this package helps turning two or three letter codes into short English names.

shortcountrynames is maintained by Robert Gieseke (robert.gieseke@pik-potsdam.de).

Data Package

Data Package, a simple 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

var shortcountrynames = require("shortcountrynames")

// Define custom codes
shortcountrynames.names["TEST"] = 'test'

console.log(shortcountrynames.to_name("DEU")) // Germany
console.log(shortcountrynames.to_name("TEST")) // test

Notes

Non-standard codes:

EU, EUU - European Union

XK, XKX - Kosovo

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

shortcountrynames-0.8.0-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shortcountrynames-0.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: shortcountrynames-0.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for shortcountrynames-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 431d445b732d12845edc10f6dd1c4f8126238db781e20a5f89df723e94c27129
MD5 3a4f4688858eacedd799a6d790e7e4fa
BLAKE2b-256 03da7c0df18b0ad4cbcdf44d0cfef9e9df73d548cd8f95a2ab937beb28a073b6

See more details on using hashes here.

Supported by

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