Skip to main content

influxdata-plugin-utils

Shared helpers for InfluxDB 3 plugins.

Install

pip install influxdata-plugin-utils

Editable, for local development:

pip install -e influxdata-plugin-utils

Modules

Module What it provides
config load_plugin_config(args, validators) (dynaconf-backed), resolve_plugin_dir(), resolve_path(), re-exported Validator
introspection get_table_names(), get_tag_names(), get_field_names(), query_window() with optional database=
parsing parse_timedelta(), parse_timestamp_ns(), parse_int(), parse_bool(), parse_delimited_list(), parse_key_value()
cache cached(influxdb3_local, key, producer, ttl_seconds=3600)
write build_line(), build_line_typed(), add_field_with_type(), write_data(), BatchLines

Config: precedence

load_plugin_config merges sources low → high: env vars → engine args → TOML file. A provided TOML config file overrides everything. Environment variables are read only when their exact names are passed via env_keys=[...]; nothing is read from the environment by default.

from influxdata_plugin_utils.config import load_plugin_config, Validator
from influxdata_plugin_utils.parsing import parse_timedelta

def process_scheduled_call(influxdb3_local, call_time, args):
    cfg = load_plugin_config(
        args,
        validators=[
            Validator("source_table", must_exist=True),
            Validator("batch_size", default=1000, gte=1, lte=10000, cast=int),
            Validator("window", default="5min", cast=parse_timedelta),
        ],
    )
    influxdb3_local.info(f"{cfg.source_table} window={cfg.window}")

TOML becomes native — no manual string parsing:

source_table = "cpu"
batch_size = 2000
excluded_fields = ["usage_idle", "usage_guest"]

Write helpers

LineBuilder is a runtime global injected into the plugin, so builders take the class as their first argument:

from influxdata_plugin_utils.write import build_line, write_data

lines = [
    build_line(LineBuilder, "cpu", tags={"host": "a"}, fields={"usage": 12.5}, time_ns=ts)
]
write_data(influxdb3_local, lines)            # batched + retried by default
# write_data(influxdb3_local, lines, batch=False, retries=0)  # opt out
# write_data(influxdb3_local, lines, database="other_db")     # another database
# write_data(influxdb3_local, lines, no_sync=True)            # write_sync API (3.8+)

Cross-database queries

On InfluxDB versions that support processing-engine cross-database queries, the introspection helpers accept database= and pass it through to influxdb3_local.query. Cached schema results are separated per database.

from influxdata_plugin_utils.introspection import get_field_names, query_window

fields = get_field_names(influxdb3_local, "cpu", database="source_db")
rows = query_window(
    influxdb3_local,
    "cpu",
    start=start,
    end=end,
    columns=fields,
    database="source_db",
)

License

Licensed under either of Apache License 2.0 or MIT license at your option.

Release files for influxdata-plugin-utils 0.3.0

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

Source distribution (sdist)

Source distribution for influxdata-plugin-utils 0.3.0
File Size Uploaded
influxdata_plugin_utils-0.3.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for influxdata-plugin-utils 0.3.0
File Interpreter ABI Platform
influxdata_plugin_utils-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.9 kB

Release files / influxdata_plugin_utils-0.3.0.tar.gz

Download URL influxdata_plugin_utils-0.3.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
de888d05c8964ac83ab97ee368ec44b702c9358fcf1fcc0a5aed6c579c153392
BLAKE2b-256 checksum
How to use checksums
7f2dd5463e22e82022f1f3b0c72f5915a59f4b90ea3d1f70cc2884a3639d3f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Release files / influxdata_plugin_utils-0.3.0-py3-none-any.whl

Download URL influxdata_plugin_utils-0.3.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4eb5e67f57d78c25d13a56c9e78a9e887363a811ec1ea2de851088a52de8cc16
BLAKE2b-256 checksum
How to use checksums
fda2cdd34a2bc6a338dbf25f4c7bf486951e742f5b1e6e5fcf66354706fb3ba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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