The `questdb` library is the official Python client for QuestDB, a high-performance open-source SQL database for time-series and analytics. It provides efficient ingestion of data via InfluxDB Line Protocol (ILP) over TCP or HTTP, supporting various Python data types, Pandas DataFrames, and NumPy arrays. The current version is 4.1.0, and releases are typically feature-driven, often aligning with new QuestDB server capabilities.
pip install questdbVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `Sender` using a configuration string for ILP over HTTP and ingest two rows of data. It also highlights the support for nanosecond precision timestamps introduced in version 4.0.0. The connection details can be configured via environment variables for easy deployment.
Ensure QuestDB server is 9.1.0+ to fully utilize nanosecond precision with `TIMESTAMP_NS` columns. For older servers, be mindful of timestamp precision or convert to microseconds before sending.
Upgrade QuestDB server to 9.0.0+ to enable n-dimensional array ingestion. Ensure NumPy arrays are of `float64` dtype.
Review `Sender.from_conf()` arguments for HTTP configuration and update error handling to catch `IngressError` for server-side errors.
Upgrade QuestDB server to 9.2.0+ to use the `DECIMAL` data type. If using an older server, convert `decimal.Decimal` objects to `float` or `string` before sending, mindful of potential precision loss.
Upgrade to `questdb>=2.0.2` or explicitly set a higher `auto_flush_rows` value (e.g., 75000) when initializing the `Sender` for HTTPS connections.