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.9.0-py2.py3-none-any.whl (8.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: shortcountrynames-0.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.3

File hashes

Hashes for shortcountrynames-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c592a13e3ee8754964442de985f0b5b4eac14d6a442754a676a030b68e742874
MD5 349a905bdfab40e41dab622481834c4a
BLAKE2b-256 50292eb2a60d58717d2d1088de8e09a49645ac9fba1c0e97e9e2c2480da20572

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