A library to map country names to ISO codes.
Project description
# countrynames
This library helps with the mapping of country names to their respective ISO 3166-2 code
names. The idea is to incorporate common names for countries, and even some limited
misspellings, as they occur in source data.
## Usage
```python
import countrynames
assert 'DE' == countrynames.to_code('Germany')
assert 'DE' == countrynames.to_code('Bundesrepublik Deutschland')
assert 'DE' == countrynames.to_code('DE')
```
## Non-standard countries
* ``XK`` - Kosovo
* ``EU`` - European Union
## License
The MIT License (MIT)
Copyright (c) 2016 Friedrich Lindenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This library helps with the mapping of country names to their respective ISO 3166-2 code
names. The idea is to incorporate common names for countries, and even some limited
misspellings, as they occur in source data.
## Usage
```python
import countrynames
assert 'DE' == countrynames.to_code('Germany')
assert 'DE' == countrynames.to_code('Bundesrepublik Deutschland')
assert 'DE' == countrynames.to_code('DE')
```
## Non-standard countries
* ``XK`` - Kosovo
* ``EU`` - European Union
## License
The MIT License (MIT)
Copyright (c) 2016 Friedrich Lindenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 Distribution
countrynames-1.0.0.tar.gz
(220.4 kB
view details)
Built Distribution
countrynames-1.0.0-py2-none-any.whl
(223.2 kB
view details)
File details
Details for the file countrynames-1.0.0.tar.gz
.
File metadata
- Download URL: countrynames-1.0.0.tar.gz
- Upload date:
- Size: 220.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed383d0315923ede5c9ca77e8420d0768d0385432209a9320703893d6a9f7f12 |
|
MD5 | c6b2a4fd9ff3545e408466c8a1e7e27d |
|
BLAKE2b-256 | 3ecfb02fe67c9e419eccd4a5df388d33bcf58285cba61e0af8702c0ee160629c |
File details
Details for the file countrynames-1.0.0-py2-none-any.whl
.
File metadata
- Download URL: countrynames-1.0.0-py2-none-any.whl
- Upload date:
- Size: 223.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fc11bc4b1a4cc3e403ebab1d34b7ffbe11bfa8f3f38ccae1065eab6b97dd9df |
|
MD5 | 0b5f5f64fea994ae8498bb77463d217c |
|
BLAKE2b-256 | 4735de438c2d7cff885b28c0587f42ae845df887ce523474efee827c8ee170c3 |