pycountry-convert


Namepycountry-convert JSON
Version 0.7.2 PyPI version JSON
download
home_pagehttps://github.com/TuneLab/pycountry-convert
SummaryExtension of Python package pycountry providing conversion functions.
upload_time2018-02-18 17:36:06
maintainer
docs_urlNone
authorTUNE Inc.
requires_python
licenseMIT License
keywords pycountry conversion tune
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. -*- mode: rst -*-

pycountry-convert
-----------------

Extension of Python package `pycountry <https://pypi.python.org/pypi/pycountry>`_ providing conversion functions.


Badges
------

.. start-badges

.. list-table::
    :stub-columns: 1

    * - docs
      - |docs| |license|
    * - info
      - |hits| |contributors|
    * - tests
      - |travis| |coveralls|
    * - package
      - |version| |supported-versions|
    * - other
      - |requires|


.. |docs| image:: https://readthedocs.org/projects/pycountry-convert/badge/?style=flat
    :alt: Documentation Status
    :target: http://pycountry-convert.readthedocs.io

.. |hits| image:: http://hits.dwyl.io/TuneLab/pycountry-convert.svg
    :alt: Hits
    :target: http://hits.dwyl.io/TuneLab/pycountry-convert

.. |contributors| image:: https://img.shields.io/github/contributors/TuneLab/pycountry-convert.svg
    :alt: Contributors
    :target: https://github.com/TuneLab/pycountry-convert/graphs/contributors

.. |license| image:: https://img.shields.io/badge/License-MIT-yellow.svg
    :alt: License Status
    :target: https://opensource.org/licenses/MIT

.. |travis| image:: https://travis-ci.org/TuneLab/pycountry-convert.svg?branch=master
    :alt: Travis-CI Build Status
    :target: https://travis-ci.org/TuneLab/pycountry-convert

.. |coveralls| image:: https://coveralls.io/repos/TuneLab/pycountry-convert/badge.svg?branch=master&service=github
    :alt: Code Coverage Status
    :target: https://coveralls.io/r/TuneLab/pycountry-convert

.. |version| image:: https://img.shields.io/pypi/v/pycountry-convert.svg?style=flat
    :alt: PyPI Package latest release
    :target: https://pypi.python.org/pypi/pycountry-convert

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pycountry-convert.svg?style=flat
    :alt: Supported versions
    :target: https://pypi.python.org/pypi/pycountry-convert

.. |requires| image:: https://requires.io/github/TuneLab/pycountry-convert/requirements.svg?branch=master
    :alt: Requirements Status
    :target: https://requires.io/github/TuneLab/pycountry-convert/requirements/?branch=master

.. end-badges


Install
-------

.. code-block:: bash

    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 <https://en.wikipedia.org/wiki/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 <https://en.wikipedia.org/wiki/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 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ .

- ``country_alpha3_to_country_name(cn_name_format="default")``: Convert `country code ISO 3166-1 alpha-3 <https://en.wikipedia.org/wiki/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 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3>`_ .

- ``country_alpha3_to_country_alpha2()``: Convert `country code ISO 3166-1 alpha-3 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3>`_ to `country code ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/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 <https://pypi.python.org/pypi>`_.

- `pycountry <https://pypi.python.org/pypi/pycountry>`_
- `pprintpp <https://pypi.python.org/pypi/pprintpp>`_


.. :changelog:

Release History
===============

0.7.2 (2018-02-16)
------------------
- Python 2.7 supported
- Travis CI testing both Python 2.7 and 3.6.

0.7.1 (2018-02-15)
------------------
- migrate to github/TuneLab.
- Python 2.7 support
- lru_cache()

0.6.7 (2018-02-15)
------------------
- pycountry: added common_name (vgavro)

0.6.6 (2018-01-25)
------------------
- migrate to github/tuneinc.
- LICENSE: MIT

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TuneLab/pycountry-convert",
    "name": "pycountry-convert",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pycountry conversion tune",
    "author": "TUNE Inc.",
    "author_email": "jefft@tune.com",
    "download_url": "https://files.pythonhosted.org/packages/be/85/a5bcf01c5e8de1b611990c723e2b88bdbfb93375e18d1539f6fa8f0f9952/pycountry-convert-0.7.2.tar.gz",
    "platform": "",
    "description": ".. -*- mode: rst -*-\n\npycountry-convert\n-----------------\n\nExtension of Python package `pycountry <https://pypi.python.org/pypi/pycountry>`_ providing conversion functions.\n\n\nBadges\n------\n\n.. start-badges\n\n.. list-table::\n    :stub-columns: 1\n\n    * - docs\n      - |docs| |license|\n    * - info\n      - |hits| |contributors|\n    * - tests\n      - |travis| |coveralls|\n    * - package\n      - |version| |supported-versions|\n    * - other\n      - |requires|\n\n\n.. |docs| image:: https://readthedocs.org/projects/pycountry-convert/badge/?style=flat\n    :alt: Documentation Status\n    :target: http://pycountry-convert.readthedocs.io\n\n.. |hits| image:: http://hits.dwyl.io/TuneLab/pycountry-convert.svg\n    :alt: Hits\n    :target: http://hits.dwyl.io/TuneLab/pycountry-convert\n\n.. |contributors| image:: https://img.shields.io/github/contributors/TuneLab/pycountry-convert.svg\n    :alt: Contributors\n    :target: https://github.com/TuneLab/pycountry-convert/graphs/contributors\n\n.. |license| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n    :alt: License Status\n    :target: https://opensource.org/licenses/MIT\n\n.. |travis| image:: https://travis-ci.org/TuneLab/pycountry-convert.svg?branch=master\n    :alt: Travis-CI Build Status\n    :target: https://travis-ci.org/TuneLab/pycountry-convert\n\n.. |coveralls| image:: https://coveralls.io/repos/TuneLab/pycountry-convert/badge.svg?branch=master&service=github\n    :alt: Code Coverage Status\n    :target: https://coveralls.io/r/TuneLab/pycountry-convert\n\n.. |version| image:: https://img.shields.io/pypi/v/pycountry-convert.svg?style=flat\n    :alt: PyPI Package latest release\n    :target: https://pypi.python.org/pypi/pycountry-convert\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pycountry-convert.svg?style=flat\n    :alt: Supported versions\n    :target: https://pypi.python.org/pypi/pycountry-convert\n\n.. |requires| image:: https://requires.io/github/TuneLab/pycountry-convert/requirements.svg?branch=master\n    :alt: Requirements Status\n    :target: https://requires.io/github/TuneLab/pycountry-convert/requirements/?branch=master\n\n.. end-badges\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n    pip install pycountry-convert\n\n\nArchitecture\n------------\n\nUsing country data derived from wikipedia, this package provides conversion\nfunctions between ISO country names, country-codes, and continent names.\n\n\nFunctions\n---------\n\n- ``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\"`.\n\n- ``country_alpha2_to_continent_code()``: Convert `country code ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ to continent name.\n\n- ``country_alpha2_to_country_name(cn_name_format=\"default\")``: Convert `country code ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ to country name.\n\n- ``country_name_to_country_alpha2(cn_name, cn_name_format=\"default\")``: Convert country name to `country code ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ .\n\n- ``country_alpha3_to_country_name(cn_name_format=\"default\")``: Convert `country code ISO 3166-1 alpha-3 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3>`_ to country name.\n\n- ``country_name_to_country_alpha3(cn_name, cn_name_format=\"default\")``: Convert country name to `country code ISO 3166-1 alpha-3 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3>`_ .\n\n- ``country_alpha3_to_country_alpha2()``: Convert `country code ISO 3166-1 alpha-3 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3>`_ to `country code ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ .\n\n\nParameter: cn_name_format\n---------------------------\n\n- ``COUNTRY_NAME_FORMAT_DEFAULT \"default\"``: Country names as provide by ``pycountry``.\n- ``COUNTRY_NAME_FORMAT_LOWER \"lower\"``: All lowercase country names.\n- ``COUNTRY_NAME_FORMAT_UPPER \"upper\"``: All uppercase country names.\n\n\nParameter: cn_extras\n---------------------------\n\nDictionary of `{ cn_name: cn_alpha2_code, ... }`\n\nDependencies\n------------\n\n``pycountry-convert`` module is built upon Python 3 and has dependencies upon\nseveral Python modules available within `Python Package Index PyPI <https://pypi.python.org/pypi>`_.\n\n- `pycountry <https://pypi.python.org/pypi/pycountry>`_\n- `pprintpp <https://pypi.python.org/pypi/pprintpp>`_\n\n\n.. :changelog:\n\nRelease History\n===============\n\n0.7.2 (2018-02-16)\n------------------\n- Python 2.7 supported\n- Travis CI testing both Python 2.7 and 3.6.\n\n0.7.1 (2018-02-15)\n------------------\n- migrate to github/TuneLab.\n- Python 2.7 support\n- lru_cache()\n\n0.6.7 (2018-02-15)\n------------------\n- pycountry: added common_name (vgavro)\n\n0.6.6 (2018-01-25)\n------------------\n- migrate to github/tuneinc.\n- LICENSE: MIT\n\n0.6.2 (2017-12-09)\n------------------\n- readthedocs.org\n\n0.5.4 (2017-12-07)\n------------------\n- LICENSE: LGPL 3.0\n\n0.5.0 (2017-11-30)\n------------------\n- README.rst\n- Hits and Contributors\n\n0.3.0 (2017-11-27)\n------------------\n- README.rst\n- Travis CI\n\n0.1.9 (2017-03-12)\n------------------\n- Makefile and README.rst\n\n0.1.8 (2016-11-19)\n------------------\n- Makefile and README.rst\n\n0.1.0 (2016-11-17)\n------------------\n- Initial Code\n- Code pulled from TuneLab/tune-mv-integration-python\n- Country name to Country Alpha-2 Code cleanup\n\n0.0.1 (2016-11-17)\n------------------\n- Initial commit\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Extension of Python package pycountry providing conversion functions.",
    "version": "0.7.2",
    "split_keywords": [
        "pycountry",
        "conversion",
        "tune"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9be726c14899a43c34e04a58e3772007afe79dbd64fac15d2fbaeedff24082f2",
                "md5": "c1de97e7b2e4f44c084aaa3ef30f556d",
                "sha256": "5e33883a88b3cb752d332ca2358ac6c4de4defc86a2b93b713b36338e914952e"
            },
            "downloads": -1,
            "filename": "pycountry_convert-0.7.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1de97e7b2e4f44c084aaa3ef30f556d",
            "packagetype": "bdist_wheel",
            "python_version": "3.6",
            "requires_python": null,
            "size": 13836,
            "upload_time": "2018-02-18T17:36:09",
            "upload_time_iso_8601": "2018-02-18T17:36:09.704798Z",
            "url": "https://files.pythonhosted.org/packages/9b/e7/26c14899a43c34e04a58e3772007afe79dbd64fac15d2fbaeedff24082f2/pycountry_convert-0.7.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be85a5bcf01c5e8de1b611990c723e2b88bdbfb93375e18d1539f6fa8f0f9952",
                "md5": "f428955fe17064b4b81c6c25a5f8074b",
                "sha256": "095d310f746bf2a5ef713b3a82eea28a27262286223765b1e7be8a5c4fa7e9b9"
            },
            "downloads": -1,
            "filename": "pycountry-convert-0.7.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f428955fe17064b4b81c6c25a5f8074b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12376,
            "upload_time": "2018-02-18T17:36:06",
            "upload_time_iso_8601": "2018-02-18T17:36:06.648758Z",
            "url": "https://files.pythonhosted.org/packages/be/85/a5bcf01c5e8de1b611990c723e2b88bdbfb93375e18d1539f6fa8f0f9952/pycountry-convert-0.7.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2018-02-18 17:36:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "TuneLab",
    "github_project": "pycountry-convert",
    "lcname": "pycountry-convert"
}
        
Elapsed time: 0.03628s