跳转到主要内容

一个提供访问Yahoo!天气RSS源接口的Python模块。

项目描述

Python模块,用于访问yahoo!天气

示例

import logging
from yahooweather import YahooWeather, UNIT_C

logging.basicConfig(level=logging.WARNING)

yweather = YahooWeather(91543049, UNIT_C)
if yweather.updateWeather():
    print("RawData: %s" % str(yweather.RawData))
    print("Units: %s" % str(yweather.Units))
    print("Now: %s" % str(yweather.Now))
    print("Forecast: %s" % str(yweather.Forecast))
    print("Wind: %s" % str(yweather.Wind))
    print("Atmosphere: %s" % str(yweather.Atmosphere))
    print("Astronomy: %s" % str(yweather.Astronomy))

    data = yweather.Now
    print("Weather image from current: %s" %
          yweather.getWeatherImage(data["code"]))

    print("The woeid from Gstaad is: %s" % get_woeid(46.475661, 7.283469))
else:
    print("Can't read data from yahoo!")

速率限制

Yahoo天气API的使用不应超过合理的请求量。每天的访问限制为2,000次签名调用。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定要选择哪一个,请了解更多关于安装包的信息。

源分布

yahooweather-0.10.tar.gz (3.8 kB 查看哈希值)

上传时间:

由以下支持