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

Uploaded Source

Built Distribution

aiohere-2.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohere-2.2.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10

File hashes

Hashes for aiohere-2.2.0.tar.gz
Algorithm Hash digest
SHA256 74dd9994e3f60af5e702f4ac534ade7d6ddeeea245fac9d5dc89bc29a92e83c6
MD5 f9471a3cd05f0fa7e22b7bad38cd6256
BLAKE2b-256 f7e60eba35b823ce72415a8e8dce5d65ae8b1d87912e191ebaa1ce8008d93446

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiohere-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10

File hashes

Hashes for aiohere-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14147b7f553ca0b5ea4d1afeb13430a785ba052ef6340c1a4940ed9efcaa96f1
MD5 a8bfc2810ee2d65540d804e8effbed67
BLAKE2b-256 297f19d498f7189c782c8258ad5433a11c970383e4c1922cc5c183047c34a359

See more details on using hashes here.

Supported by

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