https://github.com/eifinger/aiohere
Asynchronous Python client for the HERE API
https://github.com/eifinger/aiohere
Last synced: 24 days ago
JSON representation
Asynchronous Python client for the HERE API
- Host: GitHub
- URL: https://github.com/eifinger/aiohere
- Owner: eifinger
- License: mit
- Created: 2021-09-09T19:25:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-22T20:26:39.000Z (over 1 year ago)
- Last Synced: 2025-04-12T08:58:58.324Z (24 days ago)
- Language: Python
- Size: 594 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# aiohere
Asynchronous Python client for the HERE API
Based on [herepy](https://github.com/abdullahselek/HerePy)
[](https://github.com/eifinger/aiohere/actions?workflow=CI)
[](https://pypi.python.org/pypi/aiohere)
[](https://github.com/eifinger/aiohere/blob/master/LICENSE)
[](https://codecov.io/gh/eifinger/aiohere)
[](https://pepy.tech/project/aiohere)## Installation
```bash
pip install aiohere
```## Usage
```python
from aiohere import AioHere, WeatherProductTypeimport 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())
```