提供PiWeatherRock的ClimaCell预测数据
piweatherrock-data-climacell的Python项目详细描述
piweatherrock数据顶极单元
这是piweatherrock-data-climacell
Python模块的源代码。它的目的是从ClimaCell API获取PiWeatherRock所需的数据。在
导入
要使用此模块,您需要添加以下import语句:
frompiweatherrock.data_climacellimportpwr_data
命令行接口
此模块主要作为PiWeatherRock的组件存在,但也可以单独使用。它包含一个名为pwr-climacell-data
的cli,它将返回通常以JSON格式传递给PiWeatherRock的数据。这对于验证ClimaCell API返回的数据非常有用。在
例如,要查看与佐治亚州亚特兰大市相关的数据:
^{pr2}$运行上面的命令会产生类似的结果:
{"hours":[{"forecasted_conditions_icon":{"value":"clear"},"forecasted_precipitation_probability":{"value":0,"units":"%"},"forecasted_temp":{"value":72.88,"units":"F"}},{"forecasted_conditions_icon":{"value":"clear"},"forecasted_precipitation_probability":{"value":0,"units":"%"},"forecasted_temp":{"value":69.98,"units":"F"}},[trimmed]{"forecasted_conditions_icon":{"value":"clear"},"forecasted_precipitation_probability":{"value":0,"units":"%"},"forecasted_temp":{"value":77,"units":"F"}}],"day0":{"current_conditions_string":{"value":"clear"},"current_epa_aqi":{"value":69},"current_epa_health_concern":{"value":"Moderate"},"current_epa_pm10":{"value":34,"units":"µg/m3"},"current_epa_pm25":{"value":8,"units":"µg/m3"},"current_humidity":{"value":37.5,"units":"%"},"current_pollen_tree":{"value":5,"units":"Climacell Pollen Index"},"current_pollen_weed":{"value":null,"units":"Climacell Pollen Index"},"current_pollen_grass":{"value":1,"units":"Climacell Pollen Index"},"current_precipitation_rate":{"value":0,"units":"in/hr"},"current_precipitation_type":{"value":"none"},"current_temp_feels_like":{"value":75.2,"units":"F"},"current_temp_real":{"value":75.2,"units":"F"},"current_wind_direction":{"value":221.06,"units":"degrees"},"current_wind_speed":{"value":4.89,"units":"mph"},"forecasted_conditions_icon":{"value":"clear"},"forecasted_moon_phase":{"value":"waxing_gibbous"},"forecasted_sunrise":{"value":"2020-05-02T10:46:55.740Z"},"forecasted_sunset":{"value":"2020-05-03T00:21:50.569Z"},"forecasted_temp_low":{"value":65.16,"units":"F"},"forecasted_temp_high":{"value":84.58,"units":"F"},"forecasted_time_high_temp":{"value":"2020-05-02T20:00:00Z"},"forecasted_time_low_temp":{"value":"2020-05-03T09:00:00Z"},"forecasted_precipitation_probability":{"value":0,"units":"%"}},"day1":{"forecasted_conditions_icon":{"value":"drizzle"},"forecasted_moon_phase":{"value":"waxing_gibbous"},"forecasted_sunrise":{"value":"2020-05-03T10:45:58.195Z"},"forecasted_sunset":{"value":"2020-05-04T00:22:37.172Z"},"forecasted_temp_low":{"value":63.77,"units":"F"},"forecasted_temp_high":{"value":86.06,"units":"F"},"forecasted_time_high_temp":{"value":"2020-05-03T20:00:00Z"},"forecasted_time_low_temp":{"value":"2020-05-03T11:00:00Z"},"forecasted_precipitation_probability":{"value":15,"units":"%"}},"day2":{"forecasted_conditions_icon":{"value":"drizzle"},[trimmed]},"day3":{"forecasted_conditions_icon":{"value":"rain_light"},[trimmed]},"observation_time":"2020-05-03T01:34:13.050Z"}
- 项目
标签: