Skip to main content

An open-sourced wrapper to interact with the OpenWeatherMap API

Project description

Open Weather Mappy

Wrapper to interact with the Open Weather Map Current Weather Data API. Install from pip under the name owmpy.

Usage

Import the class and make requests.

import asyncio
from os import getenv

from owmpy.current import CurrentWeather


async def main():
    # Get a weather token from openweathermap.org
    async with CurrentWeather(appid=getenv("WEATHER_TOKEN")) as weather:
        response = await weather.get((0, 0))
        print(response)


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(main())

Optionally, you can supply your own ClientSession:

import aiohttp
weather = CurrentWeather(appid="token", client=aiohttp.ClientSession())

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

owmpy-0.3.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owmpy-0.3.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file owmpy-0.3.1.tar.gz.

File metadata

  • Download URL: owmpy-0.3.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for owmpy-0.3.1.tar.gz
Algorithm Hash digest
SHA256 855eee4308a8f73c8c9fc99c50b77a21b1efac9b0dc7fa930f6f0959d8eb2491
MD5 130395a037ed584a3635224f73236446
BLAKE2b-256 b12116bca120780ce3e712303861d35d5c2ea0c59fc9d65b3a4d2a4df135c0da

See more details on using hashes here.

File details

Details for the file owmpy-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: owmpy-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for owmpy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff49f4b40e3ebc8b464a13cfebdf823f71b7bde483a0562d8b2880ba4c884c4a
MD5 9e397eb7f388d8518a33a48f87828898
BLAKE2b-256 c6344769778f6b1ccc77f9bc3ea2fa6bab1e8f268796bbd23309cbf0a7c003d2

See more details on using hashes here.

Supported by

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