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.2.0.tar.gz
(11.7 kB
view details)
Built Distribution
File details
Details for the file aiohere-1.2.0.tar.gz
.
File metadata
- Download URL: aiohere-1.2.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 | 20d8e055b7166e61f13ca7b03a8e3487fd6071c29975f5e5fa0b8641a5f3b653 |
|
MD5 | 4bc2204702d82cb8116fd708b368e703 |
|
BLAKE2b-256 | 7feacc902452cc87416c582a372c208beb09b88a565ee8657af377ab848ef453 |
File details
Details for the file aiohere-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: aiohere-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.1 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 | c8968343dabea4d8d5aaf4bba0eb30c3d746f8c6255abea5008b1f2d9c9479a5 |
|
MD5 | 10a5910d4168dcbb71c6ada29df1ad5f |
|
BLAKE2b-256 | bc80a6ebc7773c3147a4278b3d7d6ed0f57c958177f5c5aefdf30633cbd219e9 |