从挪威的nilu传感器站获取污染数据的api客户端。

niluclient的Python项目详细描述


无客户端

python客户端,用于从挪威的nilu传感器站获取空气污染数据。 该软件包附带的客户端可以从nilus api获取和缓存数据。

Buy me a coffee

致谢

根据nilu.no和luftkvalite.info的api documentation, 当使用通过这个客户机获取的数据时 需要包括nilu.no和luftkvalite.info。

用法

查找一个区域中的所有电台:

importniluclientasnilustations=nilu.lookup_stations_in_area('Bergen')

查找距离某个位置20公里内的所有站点和传感器读数:

importniluclientasniluclient=nilu.create_location_client(60.123456,5.123456)# name of all stations found.station_names=client.station_names# dict of all stations with readings.stations=client.station_data# all stations NO2 readingsforstationinstations:no2_value=station.sensors[nilu.NO2].value

从指定工作站查找读数并更新缓存值:

importniluclientasniluclient=nilu.create_station_client('Kannik')no2_value=client.data.sensors[nilu.NO2].valueno2_unit=client.data.sensors[nilu.NO2].unit_of_measurement# after an hour. (Data from the api will only update on the hour) client.update()new_no2_value=client.data.sensors[nilu.NO2].value

客户端API覆盖率

空气质量指数: 获取测量值和索引

  • [x]GET/aq/utd(实现用于站过滤)-niluclient.NiluStationClient
  • [x]获取/aq/utd/{latitude}/{longitude}/{radius}-niluclient.NiluLocationClient
  • []获取/aq/historical/{fromtime}/{totime}/{station}
  • []获取/aq/historical/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

观察: 获取测量值

  • []获取/obs/utd
  • []获取/obs/utd/{latitude}/{longitude}/{radius}
  • []获取/obs/historical/{fromtime}/{totime}/{station}
  • []获取/obs/historical/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

日平均值 计算给定时间段的日平均值

  • []获取/stats/day/{fromtime}/{totime}/{station}
  • []获取/stats/day/{fromtime}/{totime}/{latitude}/{longitude}/{radius}

查找api: 列出用于筛选的元数据。

  • []get/lookup/areas-(部分使用niluclient.AREAS常量)
  • [X]获取/查找/站点-niluclient.lookup_stations_in_area('')
  • []get/lookup/components-(部分使用niluclient.MEASURABLE_COMPONENTS常量)
  • []获取/查找/aqis

源:从nilu api documentation获取的终结点和描述

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

推荐PyPI第三方库


热门话题
主类中的java访问方法   Javalog4j不读取它的log4j。属性文件   雅加达ee通过Java(web应用程序)使用iText/任何其他使用现成数据的库生成PDF报告   lua使用java阅读TeamSpeak 3消息   将日期转换为BST java   java Spring引用ProxyFactoryBean中带有ref的protoyype bean   如何使java只打印一条带有if语句的消息   java如何通过JavaMail从雅虎服务器发送电子邮件?   使用百分比和BigDecimal的java测试   java如何对字符串数组排序   java验证器+MVC+REST::更新问题   java如何阻止eclipse如此频繁地挂起?   java从AsyncTask(片段内)访问TextView   IDEJava:制作可调整大小和拖动的组件