Skip to main content

influxDB SDK

主要功能

1、函数get_new_set_data查询最新的测点数据或查询某个时刻的测点数据

Args:
    database (str): 数据库名。必填参数
    tableName (str): 表名。必填参数
    queryTime (str, optional): 查询时刻。默认值为None,表示查询最新时间。
        格式要求:'YYYY-MM-DD HH:mm:ss'。
    pointList (list[str]): 一个或多个点号。必填参数,表示查询所有点。
    influxDB (InfluxDBClient): 数据库连接对象。必填参数,表示使用默认连接。

Returns:
    Any: 查询结果,具体类型取决于查询内容和返回的数据结构。

说明:
    本函数可同时满足以下四个场景要求:
    1. 获取一个点的最新值。
    2. 获取一个点在特定时刻的值。
    3. 获取多个点的最新值。
    4. 获取多个点在特定时刻的值。

2、函数get_new_data_map查询最新的测点数据或查询某个时刻的测点数据,返回字典

Args:
        database (str): 数据库名。
        tableName (str): 表名。
        queryTime (str, optional): 查询时刻。默认为None,表示查询最新时间。格式应为'YYYY-MM-DDTHH:MM:SSZ'。
        pointList (List[str], optional): 一个或多个点号。默认为None,表示查询所有点。
        influxDB (object, optional): 数据库连接对象。默认为None,表示使用默认连接。

Returns:
    Dict: 字典,包含查询结果的键值对。

3、函数get_his_set_data_by_complete查询历史时间段一个或多个测点数据(进行数据补齐)

可同时满足下面4个场景要求:
1、获取一个[点]的[开始,结束]段的历史数据;
2、获取一个[点]的[开始,结束]段的[间隔秒]的历史数据;
3、获取多个[点...] 的[开始,结束] 段的历史数据;
4、获取多个[点...] 的[开始,结束] 段的[间隔秒] 的历史数据;

Args:
    database (str): 数据库名,必填参数
    tableName (str): 表名,必填参数
    startTime (str): 开始时间,必填参数,表示使用当前时间。
    endTime (str): 结束时间,必填参数,表示使用当前时间。
    pointList (list of str): 一个或多个点号列表,必填参数,表示查询所有点。
    interval (int, optional): 时间间隔(单位秒),默认为None,表示不使用间隔查询。
    influxDB (InfluxDBClient): InfluxDB连接对象,必填参数,表示使用默认连接。

Returns:
    dict: 包含查询结果的字典,具体结构根据实际应用情况确定。

4、函数get_his_set_data查询历史一个或多个测点数据(不进行数据补齐)

Args:
    database (str): 数据库名,必填参数
    tableName (str): 表名,必填参数
    startTime (str): 开始时间,必填参数(格式要求:"2023-12-27 13:42:00")
    endTime (str): 结束时间,必填参数(格式要求:"2023-12-27 13:42:00")
    pointList (List[str]): 一个或多个点号,必填参数
    influxDB (InfluxDBClient): 数据库连接,必填参数

Returns:
    str: 查询结果

5、函数write_history_data_to_csv将历史时间段一个或多个测点数据写入到CSV文件中(进行数据补齐)

可同时满足下面4个场景要求:
1、获取一个点的[开始,结束]段的历史数据;
2、获取一个点的[开始,结束]段的[间隔秒]的历史数据;
3、获取多个点...的[开始,结束]段的历史数据;
4、获取多个点...的[开始,结束]段的[间隔秒]的历史数据;

Args:
    database (str): 数据库名,必填参数
    tableName (str): 表名,必填参数 (在InfluxDB中通常是measurement名)
    startTime (str): 开始时间,必填参数(格式要求:"YYYY-MM-DD HH:mm:ss")
    endTime (str): 结束时间,必填参数(格式要求:"YYYY-MM-DD HH:mm:ss")
    pointList (List[str]): 一个或多个点号(测点标识),必填参数
    interval (int): 时间间隔(单位秒),必填参数
    batchSize (int): 当点位过多时,分批处理数量,选填参数,默认100
    influxDB (InfluxDBClient): InfluxDB客户端连接,必填参数
    filePath (str): 文件路径,必填参数,例如:"D:\\temp\\202401.csv" 或 "/opt/202401.csv"

Metadata

Release files for th-influx-sdk 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for th-influx-sdk 1.3.7
File Size Uploaded Provenance Actions
th-influx-sdk-1.3.7.tar.gz 9.6 kB Without provenance Details for th-influx-sdk-1.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for th-influx-sdk 1.3.7
File Interpreter ABI Platform Actions
th_influx_sdk-1.3.7-py3-none-any.whl Python 3 none any Details for th_influx_sdk-1.3.7-py3-none-any.whl

Total release size: 19.9 kB

Release files / th-influx-sdk-1.3.7.tar.gz

Download URL th-influx-sdk-1.3.7.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
70fab2259968e0323fe10cd881a18fc3c7e09c57cc07de68715a775046ada355
BLAKE2b-256 checksum
How to use checksums
2c6eb4aff6d4825b313757e81c7ecff5b5d6b78b410b0f5b1e204a81359b2d55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.16

Release files / th_influx_sdk-1.3.7-py3-none-any.whl

Download URL th_influx_sdk-1.3.7-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11056dd070b5743ab303ae8096c6058f5cc0fde49dfaba3efb16e3ffe9c665aa
BLAKE2b-256 checksum
How to use checksums
ab27bcbfe90804f5d7ba967ee98d9c3ef177b7fc4d6d93c94bccf9a9722389a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.16

Security for th-influx-sdk 1.3.7

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.

Release history Release notifications | RSS feed

This release

1.3.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page