Skip to main content

InfluxDB client, asyncio version

Project description

InfluxDB-Python-Aio


Statement

This was forked from (https://github.com/influxdata/influxdb-python), and support asyncio.
Here is the original README document. You can find more detail about InfluxDB-Python (client) and also influxdb (database). Here is only some difference and basic usage.

InfluxDB-Python is a client for interacting with InfluxDB_.

Development of this library is maintained by:

Github ID URL
@aviau (https://github.com/aviau)
@xginn8 (https://github.com/xginn8)
@sebito91 (https://github.com/sebito91)

Installation

Install, upgrade and uninstall influxdb-aio with these commands::

$ pip install influxdb-aio
$ pip install --upgrade influxdb-aio
$ pip uninstall influxdb-aio

Dependencies

The influxdb-python distribution is supported only on Python 3.6, 3.7, etc.

Main dependency is:

Examples


Here's a basic example (for more see the examples directory)

import asyncio
from influxdb_aio import InfluxDBClient


json_body = [
    {
        "measurement": "cpu_load_short",
        "tags": {
            "host": "server01",
            "region": "us-west"
        },
        "time": "2009-11-10T23:00:00Z",
        "fields": {
            "value": 0.64
        }
    }
]


async def init_client():
    client = await InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
    await client.create_database('example')
    return client.write_points(json_body)


async def main():
    client = await init_client()
    result = await client.query('select value from cpu_load_short;')
    print("Result: {0}".format(result))


if __name__ == '__main__' :
    asyncio.get_event_loop().run_until_complete(main())

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-aio-5.3.2.tar.gz (65.1 kB view details)

Uploaded Source

File details

Details for the file influxdb-aio-5.3.2.tar.gz.

File metadata

  • Download URL: influxdb-aio-5.3.2.tar.gz
  • Upload date:
  • Size: 65.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

File hashes

Hashes for influxdb-aio-5.3.2.tar.gz
Algorithm Hash digest
SHA256 b96fc9599ba529406d38b74a68f34e2ba3723c573dcb6b49dc2e315637cfd1a9
MD5 e27bbadef442d18b16243eb67044a1b0
BLAKE2b-256 f0dc19424c7304ee5142cad1804e67d43cd9202fd936c31a1267d5ecd47ddbc6

See more details on using hashes here.

Supported by

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