项目作者: vladislavkovalskyi
项目描述 :
Async OpenWeatherMap lib
高级语言: Python
项目地址: git://github.com/vladislavkovalskyi/aioowm.git
aioowm - Easy Async library for working with OpenWeatherMap
Что нужно, чтобы пользоваться библиотекой:
Установка:
pip install -U aioowm
pip install -U https://github.com/vladislavkovalskyi/aioowm/archive/master.zip
Ссылки:


Пример:
from asyncio import run
from aioowm import OWM
weather = OWM(token="OpenWeatherMap Token", language="ru")
async def app():
result = await weather.get("Saint Petersburg")
print(
f"Город: {result.city.name} ({result.city.country})\n"
f"Температура: {result.weather.temperature.now}°C\n"
f"Описание: {result.weather.description}\n"
f"Скорость ветра: {result.weather.wind.speed} м/с"
)
run(app())
Вывод:
Город: Санкт-Петербург (RU)
Температура: 2.12°C
Описание: Облачно
Скорость ветра: 1.34 м/с