嘉迅网关数据接口封装包(jx-dataapi-e8)
主要功能
- 数据查询
- 用量计算
- 网关采集设置
- 告警设置
封装功能
- 异常值处理
- 缺失值处理
- 设备变比处理
- 特殊协议解析处理
- 更换表计、更换网关编号数据衔接处理
- 通用用量计算
- 主动/被动监控告警设置
使用说明
- 安装包
pip install jx-dataapi-e8
- 使用包
# 云端版
from dataapi_e8 import DataApi
api = DataApi('https://e8api.xjiaxun.com/api','appid','appsecret')
ret = api.get_latest(devs='E80142003_0101')
# 本地版
from dataapi_e8 import DataApiLocal
api = DataApiLocal('http://127.0.0.1:8000/api','appid','appsecret')
ret = api.get_latest(devs='E80142003_0101')
初始化参数说明:
- baseurl 接口地址
- appid 接口appid
- appsecret 接口appsecret
- configObj 接口配置文件,如下
class Config(object):
# 设备更换信息配置
E8API_CHANGE_CONFIG = {
'E81022180_0101': {
# 网关编号更换情况
'wg': [
{
"mid": "E81022180_0102", # 网关编号
"tm": 0 # 采集时间
},{
"mid": "E81022180_0101",
"tm": 1590447603
}
],
# 表计更换情况
'meter': [
{
"tm": 1590447603, # 更换时间
"vals": {
"ImpEp": [ # 需要衔接的属性
28, # 更换前数值
47 # 更换后数值
]
}
}
]
}
}
# 接口数据开始时间配置
E8API_BEG_CONFIG = {
'E81022180_0101': 1590426063
}
# 需要补值的参数
E8API_FILL_ATTR_CONFIG = ['ImpEp']
- debug 启动调试模式
- timeout 接口调用超时时间
-
开放接口
详见接口文档
打包上传
python3 setup.py sdist build
twine upload ./dist/*
Metadata
Release files for jx-dataapi-e8 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jx_dataapi_e8-0.0.9.tar.gz | 13.2 kB | Without provenance | Details for jx_dataapi_e8-0.0.9.tar.gz |
Release files / jx_dataapi_e8-0.0.9.tar.gz
| Download URL | jx_dataapi_e8-0.0.9.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9840a830d20a4e217c761034fd8b550fab114fb2b01103336f9f071913e4853
|
|
BLAKE2b-256 checksum How to use checksums |
5903c6392d61f7a3509f512ceb8ca974219045231a4d47a15725a1d9f054a920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.1
|
Security for jx-dataapi-e8 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.