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](http://frictionlessdata.io/), a simple
[CSV file](shortcountrynames.csv), with two and three-letter country
codes and short English country names based on the [country-codes](https://github.com/datasets/country-codes) Data Package with some
changes and additions to the choice of short names.
## Python module
Install with
```
pip install shortcountrynames
```
Usage
```py
from shortcountrynames import to_name
assert to_name("DE") == "Germany"
assert to_name("DEU") == "Germany"
```
## JavaScript module
Install with
```
npm install shortcountrynames
```
Usage
```js
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
codes into short English names.
`shortcountrynames` is maintained by Robert Gieseke (<robert.gieseke@pik-potsdam.de>).
## Data Package
[Data Package](http://frictionlessdata.io/), a simple
[CSV file](shortcountrynames.csv), with two and three-letter country
codes and short English country names based on the [country-codes](https://github.com/datasets/country-codes) Data Package with some
changes and additions to the choice of short names.
## Python module
Install with
```
pip install shortcountrynames
```
Usage
```py
from shortcountrynames import to_name
assert to_name("DE") == "Germany"
assert to_name("DEU") == "Germany"
```
## JavaScript module
Install with
```
npm install shortcountrynames
```
Usage
```js
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
Release history Release notifications | RSS feed
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
Close
Hashes for shortcountrynames-0.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8965414bfd12791df4204c6183cb7b9964c5b5c20bff4bcd858954fbcdda148d |
|
MD5 | 51b1352dea57fb7482e24be8d348e27a |
|
BLAKE2b-256 | 5502ec6bfc277a64b918d5156e4bf05b7b6c57e6fa8c8f018bb949b1356e6110 |