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.2.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-1.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: owmpy-1.0.2.tar.gz
  • Upload date:
  • Size: 5.7 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.2.tar.gz
Algorithm Hash digest
SHA256 92a74a47d2fa7132465cc405781ba1babf207339d20adf620904c40e45620f4f
MD5 799c68fe804453b49cca2d41316d40b5
BLAKE2b-256 74de12a0a49f180d110db5b22d3b3f79eb3f5bf0299038f2ed9a86f81d05cc0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: owmpy-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4cd4c1928bb98573f20c807e3869c9dd8f7646c5d46a216dbe7df8f7210be93
MD5 8d6a64f62d5731b5944ba5f7173a4a7f
BLAKE2b-256 561adedc080e386d38e96b833b951f9bfd9079a371cf9b39fbb374aca3579ef8

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