Asynchronous Python client for the HERE API.
Project description
aiohere
Asynchronous Python client for the HERE API
Based on herepy
Installation
$ pip install aiohere
Usage
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,
product=WeatherProductType.FORECAST_7DAYS_SIMPLE,
)
lowTemperature = response["dailyForecasts"]["forecastLocation"]["forecast"][0]["lowTemperature"]
highTemperature = response["dailyForecasts"]["forecastLocation"]["forecast"][0]["highTemperature"]
weekday = response["dailyForecasts"]["forecastLocation"]["forecast"][0]["weekday"]
print(f"Temperature on {weekday} will be between {lowTemperature}°C and {highTemperature}°C")
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiohere-1.3.0.tar.gz
(12.8 kB
view details)
Built Distribution
File details
Details for the file aiohere-1.3.0.tar.gz
.
File metadata
- Download URL: aiohere-1.3.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6ae1377fb4c8175e94d574c36e48ffda03cbba352bb291a263fc46427ec86d |
|
MD5 | 073bf8ffd84b522e8bf0c7f93b80fc35 |
|
BLAKE2b-256 | 1bffae74479823adaa555ea1c0e5f39582302d110438de4e5b6fc5ab7a0bf377 |
File details
Details for the file aiohere-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: aiohere-1.3.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e4dd9024f1096d980f3980f44a78db96df19558043c3b1f8bdda62787a19b1 |
|
MD5 | 38c7a4b498d8c27f39e9e861db29a2f9 |
|
BLAKE2b-256 | dfd433eb31296cc4154bc6f1c8aab953b7929f7a3d0e8731b6d14bf879b0b8b9 |