Extension of Python package pycountry providing conversion functions.
Project description
pycountry-convert
Extension of Python package pycountry providing conversion functions.
Badges
docs |
|
---|---|
info |
|
tests |
|
package |
|
other |
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.6.2 (2017-12-09)
readthedocs.org
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
File details
Details for the file pycountry-convert-0.6.5.tar.gz
.
File metadata
- Download URL: pycountry-convert-0.6.5.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1281e33fc5a70bb0aeeee2c3a418ef9300bd79f8ab97be70940959790b0fb9a |
|
MD5 | d3a294a43e5743a36f2acdbff5f92b83 |
|
BLAKE2b-256 | 2aa34cbef5e975c9e3a409ab8963c793e3de5d882012fb2aa4fbe25c52c6621b |
Provenance
File details
Details for the file pycountry_convert-0.6.5-py3.6.egg
.
File metadata
- Download URL: pycountry_convert-0.6.5-py3.6.egg
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48f030babfb5828364decfc6aab84fb4bd646e926aa50bb3631443d15350ada |
|
MD5 | 4b8b4391c7bc4261d316e67bc1ad3261 |
|
BLAKE2b-256 | 2dea25636aa545f02903b7f770ce9c310f71895831fa66a240f47fd257d32bd8 |
Provenance
File details
Details for the file pycountry_convert-0.6.5-py3-none-any.whl
.
File metadata
- Download URL: pycountry_convert-0.6.5-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 290c8516c519c65f131b32c43c8a177cda7e4c71007fef185ddd20a693f40891 |
|
MD5 | f02178ec21170ca7b593fadf2ca6f28e |
|
BLAKE2b-256 | fe2e526e2e82561de4e70e2b684843c22f60adf112ab2cdbf7aba18a77ecd39e |