Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

实时获取城市的详细气象数据

Project Description
ChinaWeather
===========
* 通过 BeautifulSoup 解析中国气象网上的数据
* 只支持Python2


安装
===========

$ sudo pip install ChinaWeather


依赖
===========
BeautifulSoup


支持城市列表
===========
* [所有城市](http://wap.weather.gov.cn/forecast/AAH/index.html)


使用方法
===========
首先获取城市天气的网址,方法是在[所有城市](http://wap.weather.gov.cn/forecast/AAH/index.html)中找到具体的城市,注意先选省再选市,一定要具体到市,确定网页上显示的是该市的气象信息,然后复制网站。

>>> import ChinaWeather
>>> print ChinaWeather.get('http://wap.weather.gov.cn/forecast/AAH/hefei.html')[u'天气'] # 注意输入是刚才复制的网址
多云
>>> print ChinaWeather.get('http://wap.weather.gov.cn/forecast/AAH/hefei.html')[u'气压']
1021hPa


返回值结构
===========
* 天气 —— 字符串;当前天气
* 气压 —— 字符串:当前气压
* 最新实况 —— 字符串;更新时间
* 温度 —— 字符串;温度
* 体感温度 —— 字符串;体感温度
* 舒适感 —— 字符串;舒适感
* 风向 —— 字符串;风向和风力
* 相对湿度 —— 字符串;相对湿度


协议
===========
基于[WTFPL](http://en.wikipedia.org/wiki/WTFPL)协议开源。
Release History

Release History

This version
History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ChinaWeather-0.1.0.tar.gz (2.4 kB) Copy SHA256 Checksum SHA256 Source Mar 10, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting