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.1

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.1
File Size Uploaded
influxdata_plugin_utils-0.3.1.tar.gz 14.8 kB Details

Built distribution (wheel)

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

Total release size: 32.1 kB

Release files / influxdata_plugin_utils-0.3.1.tar.gz

Download URL influxdata_plugin_utils-0.3.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2b47aba1ef9c594e8b4be288ec59ad546964c35f541ef8527877e2fc7fd4b486
BLAKE2b-256 checksum
How to use checksums
5434e19f142df3196313d515a1bff845dc880756852811d6e4bad784ad5974a2
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.1-py3-none-any.whl

Download URL influxdata_plugin_utils-0.3.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7df1b4f20db0f060e1d6c1bfb88fceb852ce298941ea6b7f9ad5a55a5597876
BLAKE2b-256 checksum
How to use checksums
3504510c8d169719e770445700ed2439f206a4e93c083b297f662fe12caded2a
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

This release

0.3.1 This release

2 release files

0.3.0

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