country-capitals


Namecountry-capitals JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryGet the name of a country's capital city.
upload_time2025-01-22 02:12:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseThis is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org>
keywords iso 3166 iso 3166-1 capitals countries
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Country-Capitals
[![PyPI Downloads](https://static.pepy.tech/badge/country-capitals)](https://pepy.tech/projects/country-capitals)

Get the name of a country's capital city. That's pretty much it.

## Installation
```
pip install country_capitals
```

## Usage
You can lookup capitals by country name, code, or ISO numbers. Including `fuzzy=True` will try to use use a fuzzy matching algorithm to find the country name.
```python
from country_capitals import get_capital

get_capital("Germany")
get_capital("Germ", fuzzy=True)
get_capital("DEU")
get_capital("DE")
get_capital("276")
```

For ISO 3166-1 codes specifically, you can use `get_capital_by_iso_code` or any of the more specific functions:
```python
from country_capitals import get_capital_by_iso_code, get_capital_by_numeric, get_capital_by_alpha2, get_capital_by_alpha3

get_capital_by_iso_code("DE")
get_capital_by_iso_code("DEU")
get_capital_by_iso_code("276")
# or
get_capital_by_alpha2("DE")
get_capital_by_alpha3("DEU")
get_capital_by_numeric("276")
```



## Development
Run the tests:
```
python -m unittest
```

Build the package:
```
python -m build
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "country-capitals",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ISO 3166, ISO 3166-1, capitals, countries",
    "author": null,
    "author_email": "Kosay Jabre <kosay.jabre@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ab/bf/adbfdb42b4c3509f337278774de9726315abc0120cf71e567f319b1f62a3/country_capitals-1.0.1.tar.gz",
    "platform": null,
    "description": "# Country-Capitals\n[![PyPI Downloads](https://static.pepy.tech/badge/country-capitals)](https://pepy.tech/projects/country-capitals)\n\nGet the name of a country's capital city. That's pretty much it.\n\n## Installation\n```\npip install country_capitals\n```\n\n## Usage\nYou can lookup capitals by country name, code, or ISO numbers. Including `fuzzy=True` will try to use use a fuzzy matching algorithm to find the country name.\n```python\nfrom country_capitals import get_capital\n\nget_capital(\"Germany\")\nget_capital(\"Germ\", fuzzy=True)\nget_capital(\"DEU\")\nget_capital(\"DE\")\nget_capital(\"276\")\n```\n\nFor ISO 3166-1 codes specifically, you can use `get_capital_by_iso_code` or any of the more specific functions:\n```python\nfrom country_capitals import get_capital_by_iso_code, get_capital_by_numeric, get_capital_by_alpha2, get_capital_by_alpha3\n\nget_capital_by_iso_code(\"DE\")\nget_capital_by_iso_code(\"DEU\")\nget_capital_by_iso_code(\"276\")\n# or\nget_capital_by_alpha2(\"DE\")\nget_capital_by_alpha3(\"DEU\")\nget_capital_by_numeric(\"276\")\n```\n\n\n\n## Development\nRun the tests:\n```\npython -m unittest\n```\n\nBuild the package:\n```\npython -m build\n```\n",
    "bugtrack_url": null,
    "license": "This is free and unencumbered software released into the public domain.\n        \n        Anyone is free to copy, modify, publish, use, compile, sell, or\n        distribute this software, either in source code form or as a compiled\n        binary, for any purpose, commercial or non-commercial, and by any\n        means.\n        \n        In jurisdictions that recognize copyright laws, the author or authors\n        of this software dedicate any and all copyright interest in the\n        software to the public domain. We make this dedication for the benefit\n        of the public at large and to the detriment of our heirs and\n        successors. We intend this dedication to be an overt act of\n        relinquishment in perpetuity of all present and future rights to this\n        software under copyright law.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n        IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n        OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n        ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n        OTHER DEALINGS IN THE SOFTWARE.\n        \n        For more information, please refer to <https://unlicense.org>",
    "summary": "Get the name of a country's capital city.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/KosayJabre/Country-Capitals"
    },
    "split_keywords": [
        "iso 3166",
        " iso 3166-1",
        " capitals",
        " countries"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "40a74e056ea4c635dae9d3c4ad10bcdadca02cca19d064998766d97d37ef4aa0",
                "md5": "690a450cb8fd34941de78f37bf0b2506",
                "sha256": "779b5ec94411ea30c0ac9dce18acb2744888522390e49b33d8b4d2d5268b048c"
            },
            "downloads": -1,
            "filename": "country_capitals-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "690a450cb8fd34941de78f37bf0b2506",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6801,
            "upload_time": "2025-01-22T02:12:38",
            "upload_time_iso_8601": "2025-01-22T02:12:38.517058Z",
            "url": "https://files.pythonhosted.org/packages/40/a7/4e056ea4c635dae9d3c4ad10bcdadca02cca19d064998766d97d37ef4aa0/country_capitals-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "abbfadbfdb42b4c3509f337278774de9726315abc0120cf71e567f319b1f62a3",
                "md5": "3aeaa81e610407fbd25686cd64f808c0",
                "sha256": "ea76b17017ec6b0fd59d211666e538302e93ffaa03f02965fed163bd1fcca83d"
            },
            "downloads": -1,
            "filename": "country_capitals-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3aeaa81e610407fbd25686cd64f808c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7283,
            "upload_time": "2025-01-22T02:12:40",
            "upload_time_iso_8601": "2025-01-22T02:12:40.126627Z",
            "url": "https://files.pythonhosted.org/packages/ab/bf/adbfdb42b4c3509f337278774de9726315abc0120cf71e567f319b1f62a3/country_capitals-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-22 02:12:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KosayJabre",
    "github_project": "Country-Capitals",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "country-capitals"
}
        
Elapsed time: 0.47119s