Ctrl + K
DocumentationLog inGet started

tessl/pypi-influxdb-client

tessl install tessl/pypi-influxdb-client@1.49.0

Comprehensive 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%

task.mdevals/scenario-9/

Time Series Query System

A Python application that queries time series data from an InfluxDB database and processes the results.

Capabilities

Connect to Database

  • Establishes a connection to an InfluxDB instance using provided credentials @test

Execute Time Range Query

  • Queries data from a specific bucket within a time range @test
  • Returns structured data with measurement, tags, fields, and timestamps @test

Filter Data with Predicates

  • Queries data filtered by specific tag values @test
  • Combines time range filters with tag-based predicates @test

Export Query Results

  • Converts query results to a list of dictionaries for easy processing @test
  • Handles empty query results gracefully @test

Implementation

@generates

The implementation should:

  • Accept connection parameters (URL, token, organization, bucket)
  • Execute queries using the database's query language
  • Process and structure the query results
  • Handle connection lifecycle properly

API

class TimeSeriesQuerySystem:
    """A system for querying time series data from InfluxDB."""

    def __init__(self, url: str, token: str, org: str, bucket: str):
        """
        Initialize the query system with connection parameters.

        Args:
            url: The InfluxDB server URL
            token: Authentication token
            org: Organization name
            bucket: Default bucket name
        """
        pass

    def query_time_range(self, start: str, stop: str) -> list[dict]:
        """
        Query all data within a time range.

        Args:
            start: Start time (e.g., "-1h", "-30m", "2024-01-01T00:00:00Z")
            stop: Stop time (e.g., "now()", "2024-01-02T00:00:00Z")

        Returns:
            List of dictionaries containing measurement, tags, fields, and time
        """
        pass

    def query_with_filter(self, start: str, stop: str, tag_name: str, tag_value: str) -> list[dict]:
        """
        Query data within a time range filtered by a tag.

        Args:
            start: Start time
            stop: Stop time
            tag_name: Name of the tag to filter on
            tag_value: Value the tag must match

        Returns:
            List of dictionaries containing matching records
        """
        pass

    def close(self):
        """Close the database connection."""
        pass

Dependencies { .dependencies }

influxdb-client { .dependency }

Provides Python client library for querying time series data from InfluxDB 2.x databases.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/influxdb-client@1.49.x
tile.json