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
Release history Release notifications | RSS feed
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.5.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
owmpy-0.3.5-py3-none-any.whl
(6.4 kB
view details)
File details
Details for the file owmpy-0.3.5.tar.gz.
File metadata
- Download URL: owmpy-0.3.5.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03808f7af6a80828625d67ecc45fb14068ece1509ed4ad71a1a73bc13dd251db
|
|
| MD5 |
660b664aec4999d3179d405810ac2399
|
|
| BLAKE2b-256 |
66cef636e7940ea6eee2c4d45b7e1d1beada95f4d03dff9811bb8121794f9c11
|
File details
Details for the file owmpy-0.3.5-py3-none-any.whl.
File metadata
- Download URL: owmpy-0.3.5-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd16b0b205381e77e60651791b0d5e23d3b16102191575a0f64f30b461d904d2
|
|
| MD5 |
4f22c917b42344778200dd69ae37ec8c
|
|
| BLAKE2b-256 |
ec97c73c1961ca368bb7e7a95e6b4a8b4c0b591631b012b294a139c80203bed6
|