aiohere


Nameaiohere JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttp://github.com/eifinger/aiohere
SummaryAsynchronous Python client for the HERE API
upload_time2023-01-03 11:00:58
maintainer
docs_urlNone
authorKevin Stillhammer
requires_python>=3.8
licenseMIT
keywords aiohttp asyncio here
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiohere

Asynchronous Python client for the HERE API

Based on [herepy](https://github.com/abdullahselek/HerePy)

[![GitHub Actions](https://github.com/eifinger/aiohere/workflows/CI/badge.svg)](https://github.com/eifinger/aiohere/actions?workflow=CI)
[![PyPi](https://img.shields.io/pypi/v/aiohere.svg)](https://pypi.python.org/pypi/aiohere)
[![PyPi](https://img.shields.io/pypi/l/aiohere.svg)](https://github.com/eifinger/aiohere/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/eifinger/aiohere/branch/master/graph/badge.svg)](https://codecov.io/gh/eifinger/aiohere)
[![Downloads](https://pepy.tech/badge/aiohere)](https://pepy.tech/project/aiohere)

## Installation

```bash
pip install aiohere
```

## Usage

```python
from aiohere import AioHere, WeatherProductType

import asyncio

API_KEY = ""


async def main():
    """Show example how to get weather forecast for your location."""
    async with AioHere(api_key=API_KEY) as aiohere:
        response = await aiohere.weather_for_coordinates(
            latitude=49.9836187,
            longitude=8.2329145,
            products=[WeatherProductType.FORECAST_7DAYS_SIMPLE],
        )
        lowTemperature = response["dailyForecasts"][0]["forecasts"][0]["lowTemperature"]
        highTemperature = response["dailyForecasts"][0]["forecasts"][0][
            "highTemperature"
        ]
        weekday = response["dailyForecasts"][0]["forecasts"][0]["weekday"]

        print(
            f"Temperature on {weekday} will be between {lowTemperature}°C and {highTemperature}°C"
        )


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())
```

<a href="https://www.buymeacoffee.com/eifinger" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/black_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a><br>


            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/eifinger/aiohere",
    "name": "aiohere",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "aiohttp,asyncio,here",
    "author": "Kevin Stillhammer",
    "author_email": "kevin.stillhammer@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f2/a9/3a61749edf631133a65af7b4e34b916cbeeba6054706d45f88dd9af16767/aiohere-2.1.0.tar.gz",
    "platform": null,
    "description": "# aiohere\n\nAsynchronous Python client for the HERE API\n\nBased on [herepy](https://github.com/abdullahselek/HerePy)\n\n[![GitHub Actions](https://github.com/eifinger/aiohere/workflows/CI/badge.svg)](https://github.com/eifinger/aiohere/actions?workflow=CI)\n[![PyPi](https://img.shields.io/pypi/v/aiohere.svg)](https://pypi.python.org/pypi/aiohere)\n[![PyPi](https://img.shields.io/pypi/l/aiohere.svg)](https://github.com/eifinger/aiohere/blob/master/LICENSE)\n[![codecov](https://codecov.io/gh/eifinger/aiohere/branch/master/graph/badge.svg)](https://codecov.io/gh/eifinger/aiohere)\n[![Downloads](https://pepy.tech/badge/aiohere)](https://pepy.tech/project/aiohere)\n\n## Installation\n\n```bash\npip install aiohere\n```\n\n## Usage\n\n```python\nfrom aiohere import AioHere, WeatherProductType\n\nimport asyncio\n\nAPI_KEY = \"\"\n\n\nasync def main():\n    \"\"\"Show example how to get weather forecast for your location.\"\"\"\n    async with AioHere(api_key=API_KEY) as aiohere:\n        response = await aiohere.weather_for_coordinates(\n            latitude=49.9836187,\n            longitude=8.2329145,\n            products=[WeatherProductType.FORECAST_7DAYS_SIMPLE],\n        )\n        lowTemperature = response[\"dailyForecasts\"][0][\"forecasts\"][0][\"lowTemperature\"]\n        highTemperature = response[\"dailyForecasts\"][0][\"forecasts\"][0][\n            \"highTemperature\"\n        ]\n        weekday = response[\"dailyForecasts\"][0][\"forecasts\"][0][\"weekday\"]\n\n        print(\n            f\"Temperature on {weekday} will be between {lowTemperature}\u00b0C and {highTemperature}\u00b0C\"\n        )\n\n\nif __name__ == \"__main__\":\n    loop = asyncio.new_event_loop()\n    loop.run_until_complete(main())\n```\n\n<a href=\"https://www.buymeacoffee.com/eifinger\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/black_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" ></a><br>\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Asynchronous Python client for the HERE API",
    "version": "2.1.0",
    "split_keywords": [
        "aiohttp",
        "asyncio",
        "here"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de513df2ddfd49eaa9543f404eaedb51c604311e4cd63e080454f9ea8166b401",
                "md5": "d655d7f29b809b104ea077a9bf840b95",
                "sha256": "a7e1fabb22f294ecbdba34e3c8a01ab5f530c4cb4fdb9a57976e2c95d5b390f5"
            },
            "downloads": -1,
            "filename": "aiohere-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d655d7f29b809b104ea077a9bf840b95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6130,
            "upload_time": "2023-01-03T11:00:57",
            "upload_time_iso_8601": "2023-01-03T11:00:57.020683Z",
            "url": "https://files.pythonhosted.org/packages/de/51/3df2ddfd49eaa9543f404eaedb51c604311e4cd63e080454f9ea8166b401/aiohere-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2a93a61749edf631133a65af7b4e34b916cbeeba6054706d45f88dd9af16767",
                "md5": "bc82e5d78f4a39a39eb4dc976bc5bd71",
                "sha256": "a4d93abf4f5174f1420b92d138f93f372e26b65471dd2c610350855d8c8fded4"
            },
            "downloads": -1,
            "filename": "aiohere-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bc82e5d78f4a39a39eb4dc976bc5bd71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5768,
            "upload_time": "2023-01-03T11:00:58",
            "upload_time_iso_8601": "2023-01-03T11:00:58.327089Z",
            "url": "https://files.pythonhosted.org/packages/f2/a9/3a61749edf631133a65af7b4e34b916cbeeba6054706d45f88dd9af16767/aiohere-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-03 11:00:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "eifinger",
    "github_project": "aiohere",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiohere"
}
        
Elapsed time: 0.03518s