hdx-python-country


Namehdx-python-country JSON
Version 3.8.5 PyPI version JSON
download
home_pageNone
SummaryHDX Python country code and exchange rate (fx) utilities
upload_time2024-11-19 21:23:33
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 coverage distlib et-xmlfile filelock frictionless hdx-python-utilities humanize identify idna ijson iniconfig isodate jinja2 jsonlines jsonpath-ng jsonschema jsonschema-specifications libhxl loguru markdown-it-py marko markupsafe mdurl nodeenv openpyxl packaging petl platformdirs pluggy ply pre-commit pydantic pydantic-core pygments pyphonetics pytest pytest-cov python-dateutil python-io-wrapper python-slugify pyyaml ratelimit referencing requests requests-file rfc3986 rich rpds-py ruamel-yaml ruamel-yaml-clib shellingham simpleeval six stringcase structlog tableschema-to-template tabulate tenacity text-unidecode typer typing-extensions unidecode urllib3 validators virtualenv wheel xlrd xlrd3 xlsx2csv 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/f9/b4/5424d7d5ece34239d787e4f4e2187a01ce80172f1994d7d36669ce66317c/hdx_python_country-3.8.5.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.8.5",
    "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": "2f4bd0aaa7a275b0d9d76fc2378d3b74a3ef6a844a488a2dc727c20d4a4c5031",
                "md5": "7da8f9029973f4d49f5074d56075b08c",
                "sha256": "39f713fc85990f621a82ad0adc65636f725bc8ec741f50ef4a1149f7ee387e4b"
            },
            "downloads": -1,
            "filename": "hdx_python_country-3.8.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7da8f9029973f4d49f5074d56075b08c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 51917,
            "upload_time": "2024-11-19T21:23:31",
            "upload_time_iso_8601": "2024-11-19T21:23:31.966535Z",
            "url": "https://files.pythonhosted.org/packages/2f/4b/d0aaa7a275b0d9d76fc2378d3b74a3ef6a844a488a2dc727c20d4a4c5031/hdx_python_country-3.8.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f9b45424d7d5ece34239d787e4f4e2187a01ce80172f1994d7d36669ce66317c",
                "md5": "77145c657f20ecc0f02d787fd4136f1c",
                "sha256": "b4256ab1fe8c5ecaa3fb5e999edf5c5420edfa5948e0bf98c6ac7c24c48e9421"
            },
            "downloads": -1,
            "filename": "hdx_python_country-3.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "77145c657f20ecc0f02d787fd4136f1c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 522313,
            "upload_time": "2024-11-19T21:23:33",
            "upload_time_iso_8601": "2024-11-19T21:23:33.455566Z",
            "url": "https://files.pythonhosted.org/packages/f9/b4/5424d7d5ece34239d787e4f4e2187a01ce80172f1994d7d36669ce66317c/hdx_python_country-3.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 21:23:33",
    "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.7.0"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "24.2.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.8.30"
                ]
            ]
        },
        {
            "name": "cfgv",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "5.2.0"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "7.6.7"
                ]
            ]
        },
        {
            "name": "distlib",
            "specs": [
                [
                    "==",
                    "0.3.9"
                ]
            ]
        },
        {
            "name": "et-xmlfile",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "filelock",
            "specs": [
                [
                    "==",
                    "3.16.1"
                ]
            ]
        },
        {
            "name": "frictionless",
            "specs": [
                [
                    "==",
                    "5.18.0"
                ]
            ]
        },
        {
            "name": "hdx-python-utilities",
            "specs": [
                [
                    "==",
                    "3.7.4"
                ]
            ]
        },
        {
            "name": "humanize",
            "specs": [
                [
                    "==",
                    "4.11.0"
                ]
            ]
        },
        {
            "name": "identify",
            "specs": [
                [
                    "==",
                    "2.6.2"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "ijson",
            "specs": [
                [
                    "==",
                    "3.3.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "isodate",
            "specs": [
                [
                    "==",
                    "0.7.2"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.4"
                ]
            ]
        },
        {
            "name": "jsonlines",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "jsonpath-ng",
            "specs": [
                [
                    "==",
                    "1.7.0"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "==",
                    "4.23.0"
                ]
            ]
        },
        {
            "name": "jsonschema-specifications",
            "specs": [
                [
                    "==",
                    "2024.10.1"
                ]
            ]
        },
        {
            "name": "libhxl",
            "specs": [
                [
                    "==",
                    "5.2.2"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.7.2"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "marko",
            "specs": [
                [
                    "==",
                    "2.1.2"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "3.0.2"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "nodeenv",
            "specs": [
                [
                    "==",
                    "1.9.1"
                ]
            ]
        },
        {
            "name": "openpyxl",
            "specs": [
                [
                    "==",
                    "3.1.5"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "24.2"
                ]
            ]
        },
        {
            "name": "petl",
            "specs": [
                [
                    "==",
                    "1.7.15"
                ]
            ]
        },
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "4.3.6"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "ply",
            "specs": [
                [
                    "==",
                    "3.11"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    "==",
                    "4.0.1"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.9.2"
                ]
            ]
        },
        {
            "name": "pydantic-core",
            "specs": [
                [
                    "==",
                    "2.23.4"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    "==",
                    "2.18.0"
                ]
            ]
        },
        {
            "name": "pyphonetics",
            "specs": [
                [
                    "==",
                    "0.5.3"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "8.3.3"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "python-io-wrapper",
            "specs": [
                [
                    "==",
                    "0.3.1"
                ]
            ]
        },
        {
            "name": "python-slugify",
            "specs": [
                [
                    "==",
                    "8.0.4"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "ratelimit",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "referencing",
            "specs": [
                [
                    "==",
                    "0.35.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "requests-file",
            "specs": [
                [
                    "==",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "rfc3986",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.9.4"
                ]
            ]
        },
        {
            "name": "rpds-py",
            "specs": [
                [
                    "==",
                    "0.21.0"
                ]
            ]
        },
        {
            "name": "ruamel-yaml",
            "specs": [
                [
                    "==",
                    "0.18.6"
                ]
            ]
        },
        {
            "name": "ruamel-yaml-clib",
            "specs": [
                [
                    "==",
                    "0.2.12"
                ]
            ]
        },
        {
            "name": "shellingham",
            "specs": [
                [
                    "==",
                    "1.5.4"
                ]
            ]
        },
        {
            "name": "simpleeval",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "stringcase",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "structlog",
            "specs": [
                [
                    "==",
                    "24.4.0"
                ]
            ]
        },
        {
            "name": "tableschema-to-template",
            "specs": [
                [
                    "==",
                    "0.0.13"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "tenacity",
            "specs": [
                [
                    "==",
                    "9.0.0"
                ]
            ]
        },
        {
            "name": "text-unidecode",
            "specs": [
                [
                    "==",
                    "1.3"
                ]
            ]
        },
        {
            "name": "typer",
            "specs": [
                [
                    "==",
                    "0.13.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "unidecode",
            "specs": [
                [
                    "==",
                    "1.3.8"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.2.3"
                ]
            ]
        },
        {
            "name": "validators",
            "specs": [
                [
                    "==",
                    "0.34.0"
                ]
            ]
        },
        {
            "name": "virtualenv",
            "specs": [
                [
                    "==",
                    "20.27.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.45.0"
                ]
            ]
        },
        {
            "name": "xlrd",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "xlrd3",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "xlsx2csv",
            "specs": [
                [
                    "==",
                    "0.8.4"
                ]
            ]
        },
        {
            "name": "xlsxwriter",
            "specs": [
                [
                    "==",
                    "3.2.0"
                ]
            ]
        },
        {
            "name": "xlwt",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        }
    ],
    "lcname": "hdx-python-country"
}
        
Elapsed time: 0.36909s