The influxdb3-python library is the community Python client for InfluxDB 3.0 (also known as InfluxDB IOx or InfluxDB Cloud Serverless). It provides a Pythonic interface for writing and querying time-series data using Apache Arrow Flight (gRPC) and InfluxQL/SQL. The current version is 0.18.0, with new releases typically happening monthly or bi-monthly, incorporating new features and bug fixes for integration with InfluxDB 3.0.
Install & Compatibility
Where this runs
tested against v0.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.658s · 198.4MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 4.0s · import 0.585s · 175MB
183MB installed
● package 183MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
This client is specifically for InfluxDB 3.0 and uses 'influxdb_client_3' for its package name, distinct from the InfluxDB 2.x client ('influxdb_client').
from influxdb_client_3 import InfluxDBClient3
For InfluxDB 3.0, the `Point` class for data construction is directly available from the top-level `influxdb_client_3` package.
from influxdb_client_3 import Point
Initializes the client, writes a single data point, and then queries data from InfluxDB 3.0. Credentials are sourced from environment variables for secure and flexible deployment. Remember to replace 'YOUR_API_TOKEN' and 'YOUR_DATABASE' or set corresponding environment variables.
import os
from influxdb_client_3 import InfluxDBClient3, Point
# Ensure these environment variables are set or replace with actual values
# Example: export INFLUXDB_V3_HOST="us-east-1-1.aws.cloud2.influxdata.com"
HOST = os.environ.get("INFLUXDB_V3_HOST", "us-east-1-1.aws.cloud2.influxdata.com")
TOKEN = os.environ.get("INFLUXDB_V3_TOKEN", "YOUR_API_TOKEN")
DATABASE = os.environ.get("INFLUXDB_V3_DATABASE", "YOUR_DATABASE")
client = InfluxDBClient3(host=HOST, token=TOKEN, database=DATABASE)
try:
# Write data
point = Point("measurement1").tag("tag1", "value1").field("field1", 1.0)
client.write(point)
print("Data written successfully.")
# Query data
query = f"SELECT * FROM measurement1 WHERE time > now() - interval '1 hour'"
table = client.query(query=query, database=DATABASE)
print("\nQuery results:")
for row in table:
print(row)
except Exception as e:
print(f"An error occurred: {e}")
finally:
client.close()
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.