aio-influx
influxdb python client working with asyncio
Install
pip install aioinflux3
Initialize asynchronous client
from aioinflux3 import InfluxClient, Measurement, Query, Field
async with InfluxClient(host=..., port=..., org=..., token=...) as client:
# write code here
Write data
async with InfluxClient(host=..., port=..., org=..., token=...) as client:
await client.write(Measurement.new('measurement',
timestamp,
tag=[Field(key=tag key,
val=tag value), ],
fields=[
Field(key=filed key,
val=field value),
]
)
)
Make Query
async with InfluxClient(host=..., port=..., org=..., token=...) as client:
query = Query(bucket name, measurement=measurement name)
.range(start='-4h', end='-1s')
.filter('_field name', tag name= tag value)
.window(every='5s', fn='func name') # func name in next list
.do_yield(name='func name') # name if optional
resp = await client.query(query) # return json table
resp = await client.query(query, numpy=True) # return a numpy Structured Array
func list:
- mean
- median
- max
- min
- sum
- derivative
- distinct
- count
- increase
- skew
- spread
- stddev
- first
- last
- unique
- sort
- nonnegative derivative1
Notice
This project started for own useage. My goal is make it simple and easy to use, it's not full functional for InfluxDB v2 API. If you like it, Pls star, and tell me yourneeds in issuse, I will try my best to make it happen.
Metadata
Release files for aioinflux3 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aioinflux3-0.0.5.tar.gz | 5.4 kB | Without provenance | Details |
Release files / aioinflux3-0.0.5.tar.gz
| Download URL | aioinflux3-0.0.5.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2186fec37c2fec3f4aac9c8cd872895928b2b5c23b40014191f0680e506ec46d
|
|
BLAKE2b-256 checksum How to use checksums |
70e070f009eab8aba3976af79491e175f210cbc5059af1e0a1a1d57c60948805
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.1
|
Security for aioinflux3 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.