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

Uploaded Python 3

File details

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

File metadata

  • Download URL: owmpy-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 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.1.tar.gz
Algorithm Hash digest
SHA256 9b9c7524b6f0422a0c8c1a300a6572b2ed37edac2ba2d88a90f733af98f22e17
MD5 7afe60f6ee5dc9d9f5b4faab6382b7ca
BLAKE2b-256 4b0922d82c47c18cd43e59b6b6fe6a11f6860c09eb3bd0014093041bea39b982

See more details on using hashes here.

File details

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

File metadata

  • Download URL: owmpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af16fcbf58315457a108408a8609c3b09a71fb56ec40cd1d52353df7c7c8a0b7
MD5 f733f5e98da56e8c08947f6ce6f9c585
BLAKE2b-256 e7250d59090b7caedb1dfd4792bf69d414ad0e992373b041799dd410fadee2c9

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