``(一):安装``
从 PYPI 安装
pip install influxdb-async
从 Github 安装
pip isntall git+https://github.com/yinhuanyi/influxdb-async.git
``(二):使用方法``
from influxdb_async import InfluxdbMultiFieldsAsync
host = '100.122.0.2'
port = 8086
database = 'db1'
measurement = 'measurement1'
tags = {"host": "server1", "env": "env1"}
fields_list = [{"value": 1},
{"value": 2},
{"value": 3}]
username = 'username'
password = 'password'
# 如果influxdb没有用户名和密码
with InfluxdbMultiFieldsAsync(host, port, database, measurement, tags, fields_list) as influxdb:
influxdb.start()
# 如果influxdb有用户名和密码
with InfluxdbMultiFieldsAsync(host, port, database, measurement, tags, fields_list, username=username, password=password) as influxdb:
influxdb.start()
``(三):influxdb显示效果``
> use db1; Using database db1 > select * from measurement1; name: measurement1 time env host value ---- --- ---- ----- 1591946958016786087 env1 server1 1 1591946958229993773 env1 server1 2 1591946958438736358 env1 server1 3
Release files for influxdb-async 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| influxdb-async-1.0.3.tar.gz | 2.8 kB | Details |
Release files / influxdb-async-1.0.3.tar.gz
| Download URL | influxdb-async-1.0.3.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eda8a4f2e24cb36e0ab928063f3bcde52fb0bd19fc08f7cc2881b8410a64c04e
|
|
BLAKE2b-256 checksum How to use checksums |
e3cddcf834b572225255019eb7aa6c5e55b04003cd798ab22586121043f2e346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.3
|