从中获取和读取荷兰天气数据的Python模块气象服务器.nl

meteoserver的Python项目详细描述


气象服务器

PyPIPyPI - DownloadsDocumentation StatusPyPI - License

从中获取和读取荷兰天气数据的Python模块气象服务器.nl. 代码由开发 Marc van der Sluys来自Radboud天体物理系 荷兰奈亨大学应用能源系 荷兰阿纳姆的科学。在

安装

此软件包可以使用pip install meteoserver安装。这将自动安装 依赖包pandas和{},如果它们还没有安装。如果您是通过安装 手,确保这些包也安装好了。在

您需要在Meteoserver.nl获得一个(免费)帐户和API密钥才能下载 来自Meteoserver API的数据。在

示例使用

"""Example Python script using the Meteoserver module."""importmeteoserverasmeteomyKey='a123456789'# My Meteoserver API key - put your OWN key here!myLocation='De Bilt'# My location# Weather forecast ################################################################################## Print some help:meteo.print_help_weatherforecast()location='Unknown'# Ensure we always have a location 'name' to write to file.# Read weather-forecast data from file:# data = meteo.read_json_file_weatherforecast('WeatherForecast1.json', full=True)  # Option 1: HARMONIE/HiRLAM (48 (42?) hours)# data = meteo.read_json_file_weatherforecast('WeatherForecast2.json')  # Option 2: GFS (4/10 days), useful columns only, no location# Option 2, with ALL columns and location; don't convert to numerical format, to allow writing to file later:# data, location = meteo.read_json_file_weatherforecast('WeatherForecast2.json', full=True, loc=True, numeric=False)# Get weather-forecast data from server:# data = meteo.read_json_url_weatherforecast(myKey, myLocation, model='HARMONIE')  # Option 1: HARMONIE/HiRLAM# data = meteo.read_json_url_weatherforecast(myKey, myLocation)  # Option 2 (default): GFS, useful columns only, no location# Option 2, with ALL columns and location; don't convert to numerical format, to allow writing to file later:data,location=meteo.read_json_url_weatherforecast(myKey,myLocation,full=True,loc=True,numeric=False)# Print the data:print(data)# Write the downloaded data to a json file:meteo.write_json_file_weatherforecast('WeatherForecast3.json',location,data)# Sun forecast ###################################################################################### Print some help:meteo.print_help_sunData()# Read a Meteoserver Sun-data JSON file from disc:# current, forecast = meteo.read_json_file_sunData('SunData.json')# Return the location; don't convert to numerical format, to allow writing to file later:# current, forecast, location = meteo.read_json_file_sunData('SunData.json', loc=True, numeric=False)# Get Meteoserver Sun data from the server for the given location (and key):# current, forecast = meteo.read_json_url_sunData(myKey, myLocation)# Return the location; don't convert to numerical format, to allow writing to file later:current,forecast,location=meteo.read_json_url_sunData(myKey,myLocation,loc=True,numeric=False)# Print the current-weather and forecast dataframes:print("\nCurrent Sun/weather observation from a nearby station:")print(current)print("\nSun/weather forecast for the selected location/region:")print(forecast)# Write the downloaded data to a json file:meteo.write_json_file_sunData('SunData1.json',location,current,forecast)

Meteoserver页面

作者和许可证

参考文献

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Jackson解析非同构JSON对象数组   java为什么'Stream<T>::<A>toArray(IntFunction<A[]>)`接受没有绑定的类型参数A?   java在JavaFX2.0中获取给定布局中的节点大小?   java双链接列表创建节点   java使用HashMap添加、删除和查找   java中push_back(C++)的等效方法是什么?   java在Jetty中运行servlet时获得HTTP 500   用java显示包含图像和文本的页面的最简单文档格式   swing从选项卡窗格Java中的不同选项卡访问数据   字符串Java帮助检查登录类使用。CSV文件   java Struts 1.2.9动作链接   包含max元素的java列表   currentNode上的jcr Java空检查   在Android中使用OpenNLP的POSTaggerMe时出现java NullPointerException   java Logback只将消息记录到syslog一次   如何用Java编写构造函数的API文档   java从gallery中获取所有图像并存储在阵列中   java Maven:将外部jar文件夹添加到类路径