This is my custom aioinfluxdb client
Project description
DM-aioinfluxdb
Urls
Usage
Example
from dm_aioinfluxdb import DMAioInfluxDBClient
import asyncio
async def main():
# create client
influxdb_client = DMAioInfluxDBClient("localhost", 8086, "org", "token")
# create influxdb points
point1 = influxdb_client.create_point("example-measurement", {"value": 1.5}, {"tag1": "tag1-value"})
point2 = DMAioInfluxDBClient.create_point("example-measurement", {"value": 0}, {"tag2": "tag2-value"})
# write one or more points
await influxdb_client.write("example-bucket", point1)
await influxdb_client.write("example-bucket", [point1, point2])
if __name__ == "__main__":
asyncio.run(main())
Set custom logger
If you want set up custom logger
from dm_aioinfluxdb import DMAioInfluxDBClient
# create custom logger
class MyLogger:
def debug(self, message):
pass
def info(self, message):
pass
def warning(self, message):
print(message)
def error(self, message):
print(message)
# set up custom logger for all clients
DMAioInfluxDBClient.set_logger(MyLogger())
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
dm-aioinfluxdb-0.1.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for dm_aioinfluxdb-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dd5355e356e27940c29edfe511613255c241400c552cdba84b36d9fc8d2e9fa |
|
MD5 | 2a1fbece3b41b4a4b5c459e16166367a |
|
BLAKE2b-256 | 2d983a1e9dee26cc7eef20b8558077fc158ebae613b1b6cf5349f39fa84b20c3 |