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.7.tar.gz (5.8 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.7-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: owmpy-0.3.7.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for owmpy-0.3.7.tar.gz
Algorithm Hash digest
SHA256 46c78c55717ab0f82c6cef8ebe73179eb44d3c1833bbf52b1e2737166e7fb3ce
MD5 75354315384071f71a810a4fc1e445c5
BLAKE2b-256 c85f4209b5da1ec66b923164b3f079aef9886c9519d30491ad2b33433c5c7f2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: owmpy-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for owmpy-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b54f2de858e500bdbc9567d823f078a9ea238a9cf242b93b90595cc5029375
MD5 f72001416ab77da1894c42a423d64c78
BLAKE2b-256 7d19db99bd704bcf3e890a7a941f5c313a4556948514bacddbc24aafb40572ea

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