This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
wdk/test.py
Henrik Mertens 45e47c21a6 - added influxdb to docker compose
- added dwd data download
2022-04-26 23:31:11 +02:00

16 lines
605 B
Python

from datetime import datetime
from influxdb_client import InfluxDBClient, Point, WritePrecision
from influxdb_client.client.write_api import SYNCHRONOUS
# You can generate an API token from the "API Tokens Tab" in the UI
token = "wb4s191jc33JQ4a6wK3ZECwrrG3LuSyQd61akFa_q6ZCEsequUvFhL9Gre6FaZMA2ElCylKz26ByJ6RetkQaGQ=="
org = "test-org"
bucket = "test"
with InfluxDBClient(url="http://localhost:8086", token=token, org=org) as client:
write_api = client.write_api(write_options=SYNCHRONOUS)
data = "mem,host=host1 used_percent=23.43234543"
write_api.write(bucket, org, data)
client.close()