Skip to content

dofine/python-qweather

Repository files navigation

Python API wrapper for 和风天气

Features

Usage

暂时只支持异步(async)调用,因为最初是为集成在 homeassistant 开发的 :)

实时天气

import aiohttp
import asyncio
from python_qweather import QWeather, WeatherNow

async def test_now_weather():
    async with aiohttp.ClientSession() as client_session:
        q = QWeather(api_key=os.environ['QWEATHER_APIKEY'], session=client_session, location_key='101010100')
        now_weather = await q.async_get_now_weather()
        w = WeatherNow.from_dict(now_weather)
        print(w)

asyncio.run(test_now_weather())

TODO

Credits and Thanks

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages