Skip to main content

A wrapper for the OpenWeatherMap API

Project description

Open Weather Mappy

A wrapper for the Open Weather Map API.

Installation

pip install owmpy

Usage

Import the API and make requests.

import asyncio
from os import getenv

from owmpy.current import Client


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


if __name__ == "__main__":
    asyncio.run(main())

Optionally, you can supply your own ClientSession:

import aiohttp
weather = Client("YOUR_API_TOKEN", client_session=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-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

owmpy-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: owmpy-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for owmpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 14dcfd8e0bf33a8822aefc032e98c5c7c36b8c58e751aff69943bcfd0a6591fc
MD5 7ac64e62dc664695fde29d0d2f95cd1f
BLAKE2b-256 5d72515d493085530bc4b48ee88d8b5d2ae54ca4cc09ea7d6a6df62351c8bebe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: owmpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for owmpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c04a192d8ef0f76affa8eb38664d0ecd7094ccfeae5ea9b40d127e7e30c31c9f
MD5 84a4c94a58691620f3c26916ab137424
BLAKE2b-256 bb4c34047ad442d6e9cd1e051fdaa7cff421d82427d87e6ed0c1da22b8aa9983

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