Skip to main content

InfluxDB-Flask adds influxdb-client-python support to Flask.

Project description

InfluxDB-Flask

Documentation: InfluxDB-Flask Documentation

Introduction

InfluxDB went for a massive change from v1.7 to v2.0. They introduced a new client library influxdb-client-python to interact with the InfluxDB v2 API. InfluxDB-Flask adds influxdb-client-python support to Flask.

Note: Use this library with InfluxDB 2.x and InfluxDB 1.8+. For connecting to InfluxDB 1.7 or earlier instances, use the Flask-InfluxDB that uses InfluxDB-Python as client library.

The API of the influxdb-client-python is not the backwards-compatible with the old one - influxdb-python.

Installation

Install the extension via pip:

$ pip install influxdb-flask

Set Up

Influxdb_client can be accessed via InfluxDB class:

from flask import Flask
from influxdb_flask import InfluxDB

app = Flask(__name__)
influxdb = InfluxDB(app)

Delayed configuration of InfluxDB is also supported via init_app method:

influxdb = InfluxDB()

app = Flask(__name__)
influxdb.init_app()

Currently InfluxDB.connection instance provides the functionality of InfluxDBClient .

An included example shows how to write and query data from InfluxDB.

Configuring InfluxDB-Flask

The following configuration values can be set for InfluxDB-Flask extension:

INFLUXDB_V2_URL                       InfluxDB server API url. Default is <http://localhost:8086>
INFLUXDB_V2_ORG                       Organization name (used as a default in query and write API). Default is None
INFLUXDB_V2_TOKEN                     Authentication token.
INFLUXDB_V2_TIMEOUT                   HTTP client timeout setting for a request specified in milliseconds. Default is 10s.
INFLUXDB_V2_VERIFY_SSL                Set this to false to skip verifying SSL certificate when calling API from https server. Default is False.
INFLUXDB_V2_SSL_CA_CERT               Set this to customize the certificate file to verify the peer. Default is None.
INFLUXDB_V2_CONNECTION_POOL_MAXSIZE   Number of connections to save that can be reused by urllib3. Default is 10.
INFLUXDB_V2_AUTH_BASIC                Set this to true to enable basic authentication when talking to a InfluxDB 1.8.x that does not use auth-enabled but is protected by 
                                      a reverse proxy with basic authentication. Default is False.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

InfluxDB-Flask-0.1.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

InfluxDB_Flask-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

InfluxDB_Flask-0.1.2-1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file InfluxDB-Flask-0.1.2.tar.gz.

File metadata

  • Download URL: InfluxDB-Flask-0.1.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.15.0-48-generic

File hashes

Hashes for InfluxDB-Flask-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c9c3b0294d79b929b766f68a2f57f21ffc00e471d5be9242a19a46aa144b54e3
MD5 d2bce9f5f3f71b608e8c4029c7ff8ba4
BLAKE2b-256 8dc8919dd30be9b9cdb0ccf2e8bc59f452a61d6a5ac45371752ed57556ab766b

See more details on using hashes here.

File details

Details for the file InfluxDB_Flask-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: InfluxDB_Flask-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.15.0-48-generic

File hashes

Hashes for InfluxDB_Flask-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03c2581876d2b065a6cac7b49a87892172ed6475f952bbd0885cf84225a1b85b
MD5 427df1da6bcc5ed18424d14204cfa38f
BLAKE2b-256 43cd04ae485b2877a7cfb459cdd9694b0fe075c5a9e0988502526c15bfab1cb5

See more details on using hashes here.

File details

Details for the file InfluxDB_Flask-0.1.2-1-py3-none-any.whl.

File metadata

  • Download URL: InfluxDB_Flask-0.1.2-1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.15.0-48-generic

File hashes

Hashes for InfluxDB_Flask-0.1.2-1-py3-none-any.whl
Algorithm Hash digest
SHA256 98ac72441e5b3212054979047fef249fa37fd6e5562cffb2193f6eb0c657dc8b
MD5 2eb9bf46f79fe58b4984df1bc3458281
BLAKE2b-256 5581bc7fe23ceba1a9208454e73c9d7f50622115f2bd087ce9a6f9867c3d6138

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page