Python and InfluxDB
Powerful performance with an easy integration, powered by Telegraf, the open source data connector built by InfluxData.
5B+
Telegraf downloads
#1
Time series database
Source: DB Engines
1B+
Downloads of InfluxDB
2,800+
Contributors
Table of Contents
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started
Build IoT, analytics, and cloud applications using the Python client library with InfluxDB.
Why use the InfluxDB Python Client Library?
InfluxDB is an API-first time series database for your Python applications. Use the InfluxDB open-source Python API client to write and query data into your applications and even manage your InfluxDB instance from within your app.
Key features
- Provides API access to all InfluxDB Write and Read functionality, settings, and advanced features
- Write data in InfluxDB line protocol, point data structure, or as a pandas dataframe
- Easily configure timeouts, delays, and request retries
- Batch data to InfluxDB to gain greater efficiency
- Return InfluxDB data as a Flux Table Structure, string, csv, stream, or dataframe
- Panda dataframe integration
Get started
Batching Data with the InfluxDB's Python Client Library
Querying Data with InfluxDB's Python Client Library
Using the InfluxDB Python Client Library Administrative APIs
Read
Write
from influxdb_client import InfluxDBClient
url = 'https://us-west-2-1.aws.cloud2.influxdata.com'
token = 'my-token'
org = 'my-org'
bucket = 'my-bucket'
with InfluxDBClient(url=url, token=token, org=org) as client:
query_api = client.query_api()
tables = query_api.query('from(bucket: "my-bucket") |> range(start: -1d)')
for table in tables:
for record in table.records:
print(str(record["_time"]) + " - " + record.get_measurement()
+ " " + record.get_field() + "=" + str(record.get_value()))
Project URL Documentation Python client library starter
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started