Skip to main content

从 Helsingin Energia 网站上抓取用电信息的小型图书馆

项目描述

这个小脚本从 Helsingin Energia (Helen) 网站获取每小时用电量。这是非官方的实施,如果 Helen 更改其网站或实施任何其他验证,可能随时中断。

安装:

pip install helen_electricity_usage

用法:

import helen_electricity_usage
helen = helen_electricity_usage.Helen(username, password, metering_point_number, customer_number)
helen.login()
print helen.get_date("20141225")

要获取用户名和密码,请使用Web 界面注册(需要 Flash 和纸质发票)。注册并登录后,右上角会显示计量点编号。

示例输出(python 字典):

[{'month': 10,
 'hour': 0,
 'year': 2020,
 'waterFlowPrice': 0.0,
 'temperature': 11.8,
 'milestones': [],
 'value': 0.92999,
 'day': 1,
 'teleEuro': 0.0,
 'status': 30,
 'telePrediction': 0.0},
{'month': 10,
 'hour': 1,
 'year': 2020,
 'waterFlowPrice': 0.0,
 'temperature': 11.2,
 'milestones': [],
 'value': 0.66,
 'day': 1,
 'teleEuro': 0.0,
 'status': 30,
 'telePrediction': 0.0},
 ...
]

无法检查特定日期的数据是否可用。如果数据不可用,则提供所有字段,但值为 0.0。没有办法区分丢失的数据和没有电力消耗的小时数。通常数据在第二天就可以使用,但这不能保证。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

内置分布

helen_electricity_usage-0.5.0-py2.py3-none-any.whl (4.5 kB 查看哈希

已上传 py2 py3