shortcountrynames

Data Package with short country names

CC0-1.0 License

Downloads
7.5K
Stars
2
Committers
2

“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 ([email protected]).

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

import {names, to_name} from 'shortcountrynames'

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

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

Notes

Non-standard codes:

EU, EUU - European Union

XK, XKX - Kosovo

License

CC0