澳大利亚天气数据(来自很好。政府官员。)
weather-au的Python项目详细描述
澳大利亚天气数据(使用bom.gov.au公司)在
获取澳大利亚的Bureau of Meteorology天气数据。在
目前正在进行中的工作,可能会有重大变化!在
目的
这些模块的目的是从澳大利亚气象局的各个网站获取天气数据。在
API天气
从API的api.weather.bom.gov.au
(例如Parkville 3-hourly forecast)获取数据。在
此信息已从beta website逆向工程而来,没有关于未来访问安排、内容或可用性的信息。在
使用WeatherApi
的示例
importsysfromweather_auimportapiw=api.WeatherApi(search='parkville+vic',debug=0)location=w.location()# check if the search produced a result (other methods will also return None if the search fails).iflocationisNone:sys.exit('Search failed for location '+loc)print(f"\nLocation: {location['name']}{location['state']}, timezone:{location['timezone']}\n")forwarninw.warnings():print(f"Warning short title: {warn['short_title']}")warning=w.warning(id=warn['id'])print(f"Warning title: {warning['title']}")observations=w.observations()print(f"\nObservations (temp): {observations['temp']:2}")forecast_rain=w.forecast_rain()print(f"Forecast Rain: amount:{forecast_rain['amount']}, chance:{forecast_rain['chance']}")print('\n3 Hourly:')forfinw.forecasts_3hourly():print(f"{f['time']} temp:{f['temp']:2}, {f['icon_descriptor']}")
示例使用Summary
^{pr2}$
XML和刮削
模块:
observations
-从bomftp服务器获取XML格式的数据。在uv_index
-从基于XML编码状态的idz0107-idz0013产品获取UV数据。在place
-从基于位置的pages中获取数据。在
如果可能的话,应该使用WeatherApi,因为它使用的是API,而不是刮网页。在
澳大利亚维多利亚州墨尔本帕克维尔的样本
fromweatherimportplace,observations,uv_index# Parse http://www.bom.gov.au/places/vic/parkvilleplace_data=place.Place('vic','parkville')print(place_data.acknowedgment)station_id=place_data.station_id()print('Station ID',station_id)air_temperature=place_data.air_temperature()print('Air Temperature',air_temperature)forecast=place_data.forecast()print('Forecast',forecast)uv_data=uv_index.UvIndex('Vic')print('\n'+uv_data.acknowedgment)location_name='Melbourne'uv_message=uv_data.uv_message(uv_data.get_aac(location_name))print('UV Message for',location_name,uv_message)
免责声明
本项目与澳大利亚气象局(BOM)无关或未经其批准。在
从BOMcopyright notice:如果没有使用条款与一组材料相关联,那么您可以下载、使用和复制该材料以供个人使用,或在您的组织内使用,但您不得将该材料提供给任何其他人或用于任何商业目的。在
使用
其他示例在examples
文件夹中。在
网址
- 非FTP数据的基
ftp://ftp.bom.gov.au/anon/gen/
- 首都观察-维多利亚-墨尔本(奥林匹克公园)
http://www.bom.gov.au/fwo/IDV60901/IDV60901.95936.json
- 其中
IDV60901
是乘积,并且 95936
是气象站的id
- 其中
- 气象观测-维多利亚-墨尔本(奥林匹克公园)
http://www.bom.gov.au/fwo/IDV60910/IDV60910.95936.json
http://www.bom.gov.au/places/vic/parkville/
资源
- New weather page
- FTP public products
- Weather Data Services
- How to use BOM API for weather, tide and swell
- Github has a number of projects using bom.gov.au data
- 256 km Melbourne Radar Loop
- Catalogue of RSS Feeds
- 项目
标签: