tessl install tessl/pypi-influxdb-client@1.49.0Comprehensive Python client library for InfluxDB 2.x with sync/async APIs for writing, querying, and managing time series data.
Agent Success
Agent success rate when using this tile
82%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
69%
A system that processes time-series sensor data from CSV files and writes them to InfluxDB using efficient batch operations.
You are building a data pipeline that needs to ingest large CSV files containing sensor measurements into InfluxDB. The CSV files contain temperature, humidity, and pressure readings from multiple sensors across different locations. You need to implement a function that reads the CSV data, transforms it appropriately, and writes it efficiently to InfluxDB.
The input CSV file has the following columns:
timestamp - ISO 8601 formatted timestampsensor_id - Unique sensor identifierlocation - Geographic location of the sensortemperature - Temperature in Celsiushumidity - Relative humidity percentagepressure - Atmospheric pressure in hPaThe function should:
sensor_id and location as tagstemperature, humidity, and pressure as fields@generates
from influxdb_client import InfluxDBClient
import pandas as pd
def ingest_sensor_data(
csv_file_path: str,
influx_client: InfluxDBClient,
bucket: str,
org: str
) -> int:
"""
Ingest sensor data from CSV file into InfluxDB.
Args:
csv_file_path: Path to the CSV file containing sensor data
influx_client: Initialized InfluxDB client instance
bucket: Target bucket name for the data
org: Organization name
Returns:
Number of data points successfully written
Raises:
FileNotFoundError: If the CSV file does not exist
ValueError: If the CSV format is invalid
"""
passProvides InfluxDB 2.x client functionality for time-series data storage.
Provides data analysis and CSV reading support.