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 (rob.g@web.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.10.0-py2.py3-none-any.whl (8.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: shortcountrynames-0.10.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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for shortcountrynames-0.10.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1e25e2566703ee1fcb1737a88dec99baad30ff2ac3964a14e58982f8b2dcf5d0
MD5 52badee109975db8fc536ea538cc2dd5
BLAKE2b-256 5101bbfce8fae71961d0013aafdc6a0b848261c0bd6fe0f656181b08785e9cc1

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