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

Building

rm -r dist
python -m build
twine upload 'dist/*'

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: owmpy-0.4.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for owmpy-0.4.1.tar.gz
Algorithm Hash digest
SHA256 bae3ff52ce9101cfe68354ef24fe199da06149c16f186e3d4a1ef3decf2fc23f
MD5 46e27818219aa717c3c7c4938b60b9ae
BLAKE2b-256 1adc28f7b288166ede800fc6c31575baa19e5f7c5567d0c4df72b6fd34fc7dd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: owmpy-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for owmpy-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3302b8c52918a7e6eef4bd2601ceb71090b7171a537626f5b1c97ea2bc0d4cf7
MD5 c6e710aa088c72d469cc9ba1c4712838
BLAKE2b-256 dace9ba798f9d9a82dc99c72c421ac8fd4f3ef9d5525e91b9dc4b092e109dda8

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