Extension of Python package pycountry providing conversion functions.
Project description
pycountry-convert
Extension of Python package pycountry providing conversion functions.
Badges
info |
|
---|---|
tests |
|
package |
Install
pip install pycountry-convert
Architecture
Using country data derived from wikipedia, this package provides conversion functions between ISO country names, country-codes, and continent names.
Functions
map_countries(cn_name_format="default", cn_extras={}): Return a dict of countries with key as country name (standard and official) with ISO 3166-1 values Alpha 2, Alpha 3, and Numeric. This mapping will include countries defined within pycountry, Wikipedia, and whatever extra countries provided by parameter cn_extras. Parameter cn_name_format will format the country name as request to either be using the default layout “default”, lowercase “lower”, or uppercase “upper”.
country_alpha2_to_continent_code(): Convert country code ISO 3166-1 alpha-2 to continent name.
country_alpha2_to_country_name(cn_name_format="default"): Convert country code ISO 3166-1 alpha-2 to country name.
country_name_to_country_alpha2(cn_name, cn_name_format="default"): Convert country name to country code ISO 3166-1 alpha-2 .
country_alpha3_to_country_name(cn_name_format="default"): Convert country code ISO 3166-1 alpha-3 to country name.
country_name_to_country_alpha3(cn_name, cn_name_format="default"): Convert country name to country code ISO 3166-1 alpha-3 .
country_alpha3_to_country_alpha2(): Convert country code ISO 3166-1 alpha-3 to country code ISO 3166-1 alpha-2 .
Parameter: cn_name_format
COUNTRY_NAME_FORMAT_DEFAULT "default": Country names as provide by pycountry.
COUNTRY_NAME_FORMAT_LOWER "lower": All lowercase country names.
COUNTRY_NAME_FORMAT_UPPER "upper": All uppercase country names.
Parameter: cn_extras
Dictionary of { cn_name: cn_alpha2_code, … }
Dependencies
pycountry-convert module is built upon Python 3 and has dependencies upon several Python modules available within Python Package Index PyPI.
Release History
0.5.4 (2017-12-07)
LICENSE: LGPL 3.0
0.5.0 (2017-11-30)
README.rst
Hits and Contributors
0.3.0 (2017-11-27)
README.rst
Travis CI
0.1.9 (2017-03-12)
Makefile and README.rst
0.1.8 (2016-11-19)
Makefile and README.rst
0.1.0 (2016-11-17)
Initial Code
Code pulled from TuneLab/tune-mv-integration-python
Country name to Country Alpha-2 Code cleanup
0.0.1 (2016-11-17)
Initial commit
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
Built Distributions
Hashes for pycountry_convert-0.5.7-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5a13a17f6f037538f98fe2de6ccc717b19519eda1548cd6292fa7fca492c5b2 |
|
MD5 | ec380ae845c71e7f4d34c026198d2171 |
|
BLAKE2b-256 | 2c72b876ac0fb1c1a7acf2ccfee0afe55f3c4185ce8c62adbf58304030688d2b |
Hashes for pycountry_convert-0.5.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2513f175fa9b8d9591008e35883828c7578804f15c715b1c77c4a4f684649a |
|
MD5 | 0c4737337f2a0f57873cc10549a47f97 |
|
BLAKE2b-256 | 7c53972522a877dfdf8e218494c482f435109938846beae49d36220b092c4ac0 |