hdx-python-country


Namehdx-python-country JSON
Version 3.7.0 PyPI version JSON
download
home_pageNone
SummaryHDX Python country code and exchange rate (fx) utilities
upload_time2024-03-25 22:07:22
maintainerNone
docs_urlNone
authorMichael Rans
requires_python>=3.8
licenseMIT
keywords hdx country country code currencies currency exchange rate foreign exchange fx iso 3166 iso2 iso3 location region
VCS
bugtrack_url
requirements annotated-types attrs certifi cfgv chardet charset-normalizer click colorama coverage distlib et-xmlfile filelock frictionless hdx-python-utilities humanize identify idna ijson iniconfig isodate jinja2 jsonlines jsonpath-ng jsonschema libhxl loguru markdown-it-py marko markupsafe mdurl nodeenv openpyxl packaging petl platformdirs pluggy ply pre-commit pydantic pydantic-core pygments pyphonetics pyrsistent pytest pytest-cov python-dateutil python-io-wrapper python-slugify pyyaml ratelimit requests requests-file rfc3986 rich ruamel-yaml ruamel-yaml-clib shellingham simpleeval six stringcase structlog tableschema-to-template tabulate text-unidecode typer typing-extensions unidecode urllib3 validators virtualenv wheel xlrd xlrd3 xlsxwriter xlwt
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build Status](https://github.com/OCHA-DAP/hdx-python-country/actions/workflows/run-python-tests.yaml/badge.svg)](https://github.com/OCHA-DAP/hdx-python-country/actions/workflows/run-python-tests.yaml)
[![Coverage Status](https://coveralls.io/repos/github/OCHA-DAP/hdx-python-country/badge.svg?branch=main&ts=1)](https://coveralls.io/github/OCHA-DAP/hdx-python-country?branch=main)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Downloads](https://img.shields.io/pypi/dm/hdx-python-country.svg)](https://pypistats.org/packages/hdx-python-country)

The HDX Python Country Library provides utilities to map between country and region
codes and names and to match administrative level names from different sources.
It also provides utilities for foreign exchange enabling obtaining current and historic
FX rates for different currencies.

It provides country mappings including ISO 2 and ISO 3 letter codes (ISO 3166) and regions
using live official data from the [UN OCHA](https://vocabulary.unocha.org/) feed with
fallbacks to an internal static file if there is any problem with retrieving data from
the url. (Also it is possible to force the use of the internal static files.)

It can exact match English, French, Spanish, Russian, Chinese and Arabic. There is a
fuzzy matching for English look up that can handle abbreviations in country names like
Dem. for Democratic and Rep. for Republic.

Mapping administration level names from a source to a given base set is also handled
including phonetic fuzzy name matching.

It also provides foreign exchange rates and conversion from amounts in local
currency to USD and vice-versa. The conversion relies on Yahoo Finance, falling
back on [currency-api](https://github.com/fawazahmed0/currency-api) for current rates, and Yahoo Finance falling back
on IMF data via IATI (with interpolation) for historic daily rates.

For more information, please read the [documentation](https://hdx-python-country.readthedocs.io/en/latest/).

This library is part of the [Humanitarian Data Exchange](https://data.humdata.org/)
(HDX) project. If you have humanitarian related data, please upload your datasets to
HDX.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hdx-python-country",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "HDX, country, country code, currencies, currency, exchange rate, foreign exchange, fx, iso 3166, iso2, iso3, location, region",
    "author": "Michael Rans",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/27/14/c91628a231d9de668d33c958b99e8ab89f24424c79402f76554da40c0343/hdx_python_country-3.7.0.tar.gz",
    "platform": null,
    "description": "[![Build Status](https://github.com/OCHA-DAP/hdx-python-country/actions/workflows/run-python-tests.yaml/badge.svg)](https://github.com/OCHA-DAP/hdx-python-country/actions/workflows/run-python-tests.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/OCHA-DAP/hdx-python-country/badge.svg?branch=main&ts=1)](https://coveralls.io/github/OCHA-DAP/hdx-python-country?branch=main)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Downloads](https://img.shields.io/pypi/dm/hdx-python-country.svg)](https://pypistats.org/packages/hdx-python-country)\n\nThe HDX Python Country Library provides utilities to map between country and region\ncodes and names and to match administrative level names from different sources.\nIt also provides utilities for foreign exchange enabling obtaining current and historic\nFX rates for different currencies.\n\nIt provides country mappings including ISO 2 and ISO 3 letter codes (ISO 3166) and regions\nusing live official data from the [UN OCHA](https://vocabulary.unocha.org/) feed with\nfallbacks to an internal static file if there is any problem with retrieving data from\nthe url. (Also it is possible to force the use of the internal static files.)\n\nIt can exact match English, French, Spanish, Russian, Chinese and Arabic. There is a\nfuzzy matching for English look up that can handle abbreviations in country names like\nDem. for Democratic and Rep. for Republic.\n\nMapping administration level names from a source to a given base set is also handled\nincluding phonetic fuzzy name matching.\n\nIt also provides foreign exchange rates and conversion from amounts in local\ncurrency to USD and vice-versa. The conversion relies on Yahoo Finance, falling\nback on [currency-api](https://github.com/fawazahmed0/currency-api) for current rates, and Yahoo Finance falling back\non IMF data via IATI (with interpolation) for historic daily rates.\n\nFor more information, please read the [documentation](https://hdx-python-country.readthedocs.io/en/latest/).\n\nThis library is part of the [Humanitarian Data Exchange](https://data.humdata.org/)\n(HDX) project. If you have humanitarian related data, please upload your datasets to\nHDX.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "HDX Python country code and exchange rate (fx) utilities",
    "version": "3.7.0",
    "project_urls": {
        "Homepage": "https://github.com/OCHA-DAP/hdx-python-country"
    },
    "split_keywords": [
        "hdx",
        " country",
        " country code",
        " currencies",
        " currency",
        " exchange rate",
        " foreign exchange",
        " fx",
        " iso 3166",
        " iso2",
        " iso3",
        " location",
        " region"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0af48bebee51a71c257234c47dbe5a4b0b992b9fdc59f03dc52964620b3076f5",
                "md5": "aaea4bf437d636f0f2d4bc08c8ba7493",
                "sha256": "cc1e2bc1d2adde07f67a959a8c10a76b94ad04de0638a42c230f7f296ec7e47d"
            },
            "downloads": -1,
            "filename": "hdx_python_country-3.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aaea4bf437d636f0f2d4bc08c8ba7493",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 49447,
            "upload_time": "2024-03-25T22:07:19",
            "upload_time_iso_8601": "2024-03-25T22:07:19.679292Z",
            "url": "https://files.pythonhosted.org/packages/0a/f4/8bebee51a71c257234c47dbe5a4b0b992b9fdc59f03dc52964620b3076f5/hdx_python_country-3.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2714c91628a231d9de668d33c958b99e8ab89f24424c79402f76554da40c0343",
                "md5": "d98de15963c0e1afba47057ef1a0b319",
                "sha256": "6fcd4b78cbe64bb6540e6af18154dc199bbd4d5699762982a231d93240a43cd2"
            },
            "downloads": -1,
            "filename": "hdx_python_country-3.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d98de15963c0e1afba47057ef1a0b319",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 492492,
            "upload_time": "2024-03-25T22:07:22",
            "upload_time_iso_8601": "2024-03-25T22:07:22.863544Z",
            "url": "https://files.pythonhosted.org/packages/27/14/c91628a231d9de668d33c958b99e8ab89f24424c79402f76554da40c0343/hdx_python_country-3.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-25 22:07:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCHA-DAP",
    "github_project": "hdx-python-country",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "annotated-types",
            "specs": [
                [
                    "==",
                    "0.6.0"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "23.2.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.2.2"
                ]
            ]
        },
        {
            "name": "cfgv",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "5.2.0"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.3.2"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "7.4.4"
                ]
            ]
        },
        {
            "name": "distlib",
            "specs": [
                [
                    "==",
                    "0.3.8"
                ]
            ]
        },
        {
            "name": "et-xmlfile",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "filelock",
            "specs": [
                [
                    "==",
                    "3.13.3"
                ]
            ]
        },
        {
            "name": "frictionless",
            "specs": [
                [
                    "==",
                    "5.16.1"
                ]
            ]
        },
        {
            "name": "hdx-python-utilities",
            "specs": [
                [
                    "==",
                    "3.6.7"
                ]
            ]
        },
        {
            "name": "humanize",
            "specs": [
                [
                    "==",
                    "4.9.0"
                ]
            ]
        },
        {
            "name": "identify",
            "specs": [
                [
                    "==",
                    "2.5.35"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.6"
                ]
            ]
        },
        {
            "name": "ijson",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "isodate",
            "specs": [
                [
                    "==",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.3"
                ]
            ]
        },
        {
            "name": "jsonlines",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "jsonpath-ng",
            "specs": [
                [
                    "==",
                    "1.6.1"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "==",
                    "4.17.3"
                ]
            ]
        },
        {
            "name": "libhxl",
            "specs": [
                [
                    "==",
                    "5.2.1"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.7.2"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "marko",
            "specs": [
                [
                    "==",
                    "2.0.3"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "2.1.5"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "nodeenv",
            "specs": [
                [
                    "==",
                    "1.8.0"
                ]
            ]
        },
        {
            "name": "openpyxl",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "24.0"
                ]
            ]
        },
        {
            "name": "petl",
            "specs": [
                [
                    "==",
                    "1.7.15"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "4.2.0"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "ply",
            "specs": [
                [
                    "==",
                    "3.11"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    "==",
                    "3.7.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.6.4"
                ]
            ]
        },
        {
            "name": "pydantic-core",
            "specs": [
                [
                    "==",
                    "2.16.3"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    "==",
                    "2.17.2"
                ]
            ]
        },
        {
            "name": "pyphonetics",
            "specs": [
                [
                    "==",
                    "0.5.3"
                ]
            ]
        },
        {
            "name": "pyrsistent",
            "specs": [
                [
                    "==",
                    "0.20.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "8.1.1"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.8.2"
                ]
            ]
        },
        {
            "name": "python-io-wrapper",
            "specs": [
                [
                    "==",
                    "0.3.1"
                ]
            ]
        },
        {
            "name": "python-slugify",
            "specs": [
                [
                    "==",
                    "8.0.4"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "ratelimit",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "requests-file",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rfc3986",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.7.1"
                ]
            ]
        },
        {
            "name": "ruamel-yaml",
            "specs": [
                [
                    "==",
                    "0.18.6"
                ]
            ]
        },
        {
            "name": "ruamel-yaml-clib",
            "specs": [
                [
                    "==",
                    "0.2.8"
                ]
            ]
        },
        {
            "name": "shellingham",
            "specs": [
                [
                    "==",
                    "1.5.4"
                ]
            ]
        },
        {
            "name": "simpleeval",
            "specs": [
                [
                    "==",
                    "0.9.13"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "stringcase",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "structlog",
            "specs": [
                [
                    "==",
                    "24.1.0"
                ]
            ]
        },
        {
            "name": "tableschema-to-template",
            "specs": [
                [
                    "==",
                    "0.0.13"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "text-unidecode",
            "specs": [
                [
                    "==",
                    "1.3"
                ]
            ]
        },
        {
            "name": "typer",
            "specs": [
                [
                    "==",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.10.0"
                ]
            ]
        },
        {
            "name": "unidecode",
            "specs": [
                [
                    "==",
                    "1.3.8"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "validators",
            "specs": [
                [
                    "==",
                    "0.24.0"
                ]
            ]
        },
        {
            "name": "virtualenv",
            "specs": [
                [
                    "==",
                    "20.25.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.43.0"
                ]
            ]
        },
        {
            "name": "xlrd",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "xlrd3",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "xlsxwriter",
            "specs": [
                [
                    "==",
                    "3.2.0"
                ]
            ]
        },
        {
            "name": "xlwt",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        }
    ],
    "lcname": "hdx-python-country"
}
        
Elapsed time: 0.23199s