Influxdb python sending multiple values

I have multiple measurements: temperature, humidity, wind, co2 etc.
I use the following script, how can i send multiple records?

import influxdb_client
from influxdb_client.client.write_api import SYNCHRONOUS

bucket = "<my-bucket>"
org = "<my-org>"
token = "<my-token>"
# Store the URL of your InfluxDB instance
url="https://us-central1-1.gcp.cloud2.influxdata.com"

client = influxdb_client.InfluxDBClient(
    url=url,
    token=token,
    org=org
)

write_api = client.write_api(write_options=SYNCHRONOUS)

p = influxdb_client.Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
write_api.write(bucket=bucket, org=org, record=p)

Hi @Bra1nsen,
You have a few options available to you:

        """
        Write Line Protocol formatted as string
        """
        _write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek water_level=2.0 2",
                                                    "h2o_feet,location=coyote_creek water_level=3.0 3"])

        """
        Write Line Protocol formatted as byte array
        """
        _write_client.write("my-bucket", "my-org", "h2o_feet,location=coyote_creek water_level=1.0 1".encode())
        _write_client.write("my-bucket", "my-org", ["h2o_feet,location=coyote_creek water_level=2.0 2".encode(),
                                                    "h2o_feet,location=coyote_creek water_level=3.0 3".encode()])

        """
        Write Dictionary-style object
        """
        _write_client.write("my-bucket", "my-org", [{"measurement": "h2o_feet", "tags": {"location": "coyote_creek"},
                                                     "fields": {"water_level": 2.0}, "time": 2},
                                                    {"measurement": "h2o_feet", "tags": {"location": "coyote_creek"},
                                                     "fields": {"water_level": 3.0}, "time": 3}])

        """
        Write Data Point
        """
        _write_client.write("my-bucket", "my-org",
                            [Point("h2o_feet").tag("location", "coyote_creek").field("water_level", 5.0).time(5),
                             Point("h2o_feet").tag("location", "coyote_creek").field("water_level", 6.0).time(6)])

        """
        Write Observable stream
        """
        _data = rx \
            .range(7, 11) \
            .pipe(ops.map(lambda i: "h2o_feet,location=coyote_creek water_level={0}.0 {0}".format(i)))

        _write_client.write("my-bucket", "my-org", _data)

        """
        Write Pandas DataFrame
        """
        _now = datetime.utcnow()
        _data_frame = pd.DataFrame(data=[["coyote_creek", 1.0], ["coyote_creek", 2.0]],
                                   index=[_now, _now + timedelta(hours=1)],
                                   columns=["location", "water_level"])

        _write_client.write("my-bucket", "my-org", record=_data_frame, data_frame_measurement_name='h2o_feet',
                            data_frame_tag_columns=['location'])

Essentially if you want to keep using the point object you store them within an array. then point the record parameter at the array.

thanks for reply jay =)

decided for data point methodology:

write_api.write(bucket=bucket, org=org, [Point("Rotations").field("rotations", rot),Point("VaneValue").field("vane_value", vv),Point("Winddirection").field("wind_direction", wdir),Point("Pressure").field("air_pressure", mbar),Point("Humidity").field("humidity", hum),Point("Temperature").field("temperature", temp)])														 

any idea whats wrong there?
cant spot the mistake =(

File "/home/pi/arduinoDB.py", line 65
    write_api.write(bucket=bucket, org=org, [Point("Rotations").field("rotations", rot),Point("VaneValue").field("vane_value", vv),Point("Winddirection").field("wind_direction", wdir),Point("Pressure").field("air_pressure", mbar),Point("Humidity").field("humidity", hum),Point("Temperature").field("temperature", temp)]) 
                                                                                                                                                                                                                                                                                                                               ^
SyntaxError: positional argument follows keyword argument

Hi @Bra1nsen,
Sorry, that could have been my mistake with positional arguments. Could you try this:

write_api.write(bucket=bucket, org=org, record=[Point("Rotations").field("rotations", rot),Point("VaneValue").field("vane_value", vv),Point("Winddirection").field("wind_direction", wdir),Point("Pressure").field("air_pressure", mbar),Point("Humidity").field("humidity", hum),Point("Temperature").field("temperature", temp)])

Also looking at your line protocol. I would strongly recommend keeping all these fields under one measurement. This will make your life a lot easier querying the data.

Here is an example:

        _write_client.write(bucket="generators", record=[Point("machine").tag("name", "machine_1").field("rotations", 5).field("vane_value", 2).field("wind_direction", 12).field("air_pressure", 1).field("humidity", 4).field("temperature", 5), 
                                                         Point("machine").tag("name", "machine_2").field("rotations", 5).field("vane_value", 2).field("wind_direction", 12).field("air_pressure", 1).field("humidity", 4).field("temperature", 5) ])