Open-Weather 是一个开源的气象数据获取项目
运行qweather.py
可获取由q-weather.info提供的国内五分钟实况数据
程序基于Python3,需要安装requests
库
编辑配置文件config.cfg
中的stations
项可更改获取的站点(站点WMOID数组)
获取的数据储存在data
文件夹下的WMOID.csv
文件中,同一时间重复获取数据不会覆盖
运行qweather.py
获取数据,由运行主机发起请求
代码 | 表意 |
---|---|
9998 | 无此数据 |
选项 | 表意 |
---|---|
stations | 要爬取的站点WMOID |
pfix | 对应站点的海拔高度(米) |
saveAsJson | 保存为JSON文件 |
{
"时间(yyyyMMddhhmm)":
[
气温(℃),
露点(℃,计算值),
相对湿度,
站压(hPa),
海平面气压(hPa,计算值),
风向(度),
风速(m/s),
一小时降水量(mm),
能见度(km)
],
...
}