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%
Build a command-line tool that queries InfluxDB time series data and outputs results in multiple formats based on user requirements.
You need to implement a tool that retrieves temperature sensor data from InfluxDB and provides flexible output formatting. The tool should support three different output modes to accommodate different use cases:
Your implementation should:
structured, csv, or summarystructured format: Print each record showing measurement name, timestamp, field names and valuescsv format: Print the raw CSV output from the querysummary format: Convert results to a format suitable for statistical analysis and compute mean and max temperature@generates
def query_temperature_data(client, bucket: str, format_type: str):
"""
Query temperature sensor data from InfluxDB and output in specified format.
Args:
client: InfluxDB client instance
bucket: Name of the bucket to query
format_type: Output format - 'structured', 'csv', or 'summary'
Returns:
None (prints output to console)
"""
passPython client library for InfluxDB 2.x providing query capabilities with multiple output formats.