Skip to main content

Asynchronous Python client for the HERE API.

Project description

aiohere

Asynchronous Python client for the HERE API

Based on herepy

GitHub Actions PyPi PyPi codecov Downloads

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())

Buy Me A Coffee

Project details


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.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

aiohere-1.3.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file aiohere-1.3.1.tar.gz.

File metadata

  • Download URL: aiohere-1.3.1.tar.gz
  • Upload date:
  • Size: 11.9 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

Hashes for aiohere-1.3.1.tar.gz
Algorithm Hash digest
SHA256 72c48e4fa64ea99a891f938333ad9a3fc0e081d0241f4d804b4db617f8abb90f
MD5 4185546d5e3b5bf1b2176a6b2354b94a
BLAKE2b-256 39de2278d6eb55df331f6c81106ff2bea96f9d3376418a3b5d457515fa165b8c

See more details on using hashes here.

File details

Details for the file aiohere-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: aiohere-1.3.1-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.3 CPython/3.9.7

File hashes

Hashes for aiohere-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 192fd06fac9272ede89c35b68151583a8210dcf20cea118915bacf83ba73a4fa
MD5 7013cf9f917f2360db8e1b16e82c3165
BLAKE2b-256 5fa2055cde06fb2e931e235a694cc1e01acebda6b27d181636892f192a27e3c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page