shortcountrynames
v0.15.0
Published
[](https://pypi.org/project/shortcountrynames/) [](https://www.npmjs.com/package/shortcountrynames)
Readme
This package helps turning two or three letter codes into short English names.
shortcountrynames is maintained by Robert Gieseke ([email protected]).
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 shortcountrynamesUsage
from shortcountrynames import to_name
assert to_name("DE") == "Germany"
assert to_name("DEU") == "Germany"JavaScript module
Install with
npm install shortcountrynamesUsage
import {names, to_name} from 'shortcountrynames'
// Define custom codes
names["FOO"] = 'Foo'
console.log(to_name("DEU")) // Germany
console.log(to_name("FOO")) // FooNotes
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 --tagsLicense
CC0
