docs-v2/content/influxdb3/enterprise/reference/client-libraries/v3/python.md

1.7 KiB

title list_title description menu influxdb3/enterprise/tags metadata weight aliases related list_code_example source
Python client library for InfluxDB 3 Python The InfluxDB 3 `influxdb3-python` Python client library integrates with Python scripts and applications to write and query data stored in an InfluxDB Core database.
influxdb3_enterprise
name parent identifier
Python v3 client libraries influxdb3-python
Flight API
python
gRPC
SQL
client libraries
influxdb3-python v0.10.0
201
/influxdb3/enterprise/reference/client-libraries/v3/pyinflux3/
/influxdb3/enterprise/query-data/execute-queries/troubleshoot/
<!--Hide setup ```python import os from influxdb_client_3 import InfluxDBClient3 client = InfluxDBClient3(host=f"{{< influxdb/host >}}", database=f"DATABASE_NAME", token=f"DATABASE_TOKEN") ``` --> <!--pytest-codeblocks:cont--> ```python # Example: Write and query data # Write sensor data in batches from a CSV file to a database client.write_file(file='./data/home-sensor-data.csv', timestamp_column='time', tag_columns=["room"]) # Execute a query and retrieve data from the last 90 days table = client.query( '''SELECT * FROM home WHERE time >= now() - INTERVAL '90 days' ORDER BY time''') # This script assumes the client object is correctly configured # with your database name, token, and host URL. # After the script runs, the table variable contains the data # formatted as a PyArrow table. ``` /shared/influxdb-client-libraries-reference/v3/python.md