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

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

Uploaded Source

Built Distribution

aiohere-2.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohere-2.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for aiohere-2.0.2.tar.gz
Algorithm Hash digest
SHA256 702a395b4be64ebe59447b96c543ef22405d34cf97c097006f7220fadca5c3d0
MD5 81833b86bc295f001f9f3c5650234307
BLAKE2b-256 0f456e2c89bcce29573ecd815d9672a1198fe6cabc47aef9cb315fbfec519a83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiohere-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for aiohere-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 311e16f43e5f3e949d1ab47f2324c0d7bf98a019e7480593d7fa309361b1e5f3
MD5 8e938b0af73acb56f3871600139ad052
BLAKE2b-256 73e3bcd9868cc5a7ee02de14fc5c8cb1a0a30926f59e21a5a332176755a44e7b

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