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.1.0.tar.gz
(11.7 kB
view details)
Built Distribution
File details
Details for the file aiohere-1.1.0.tar.gz
.
File metadata
- Download URL: aiohere-1.1.0.tar.gz
- Upload date:
- Size: 11.7 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.2 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c293e014889cf0738d9d873c32509105a37fdd72aa180ff1ef1e8598c3f78f39 |
|
MD5 | aca4e6e0e9c9821860a81f204ef84ae9 |
|
BLAKE2b-256 | 9f2d782ff2fa8a1be8edcacfea41dfea8b4af2f9774b8874e9659d04f3f72665 |
Provenance
File details
Details for the file aiohere-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiohere-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.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.2 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 482096df11dc77c3acd8689ab21d918d0f9952e122f86ad6da422e4aa2477bf1 |
|
MD5 | fbc26020adb252f67ca137acd0645517 |
|
BLAKE2b-256 | bf7eb1dee19eb0a23f34118c87d1f733e705e3fbe4a862d29828919287c17cfa |