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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohere-1.4.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.15

File hashes

Hashes for aiohere-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d5f44dc9524a61fd48b4214a6fd045ec7488632cee4ec6b3ed0014501d472262
MD5 664a299a615c752ac680ad9e353eb1c0
BLAKE2b-256 f839b6cb411788cd0f50bbc4a48610ea042cbcc24860dbbe14e848d0953ec38f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiohere-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.15

File hashes

Hashes for aiohere-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8bba4e6bb57d5f6c29ce9c1b37a2ca434427672ca986efe4e67ff7c6f6ad757
MD5 d8740c932e86ebabe330dc423027c282
BLAKE2b-256 fde565aa54635cd1ee6a1b59ec47a01307aa17edf5ec3c869547d4399e59b9aa

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