I believe the reasoning is that `client.write()` is more for internal use
within the `client` class, since it does require specifying the correct URL
parameters on every request (which quickly becomes tiresome). I'd recommend
using the `client.write_points()
<https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L353>`
method instead. This will change your gist to:

https://gist.github.com/rossmcdonald/83e64ba61d1ec3e43f05e5568e7350e2

Where `data` is a list of dictionaries/points. This also gives you the
added benefit of automatic batching of writes (the `batch_size` kwarg) and
other useful keyword arguments.

Thanks,
Ross

On Tue, Jun 28, 2016 at 11:45 AM, Anders Wallin <anders.e.e.wal...@gmail.com
> wrote:

> Hi all,
>
> I'm using python to collect measurements and wanted a minimal write()
> function that is easier to use than SeriesHelper.
>
> I came up with something like this:
>
> https://gist.github.com/aewallin/906b5bc5b756c67be14cb9ab7e6e49dc#file-influxdb_write-py-L21
>
> What is puzzling is the required params={'db':dbname} in the
> client.write() call.
> I would have expected the  InfluxDBClient constructor to take host, port,
> database as parameters and then not ask for them again later!?
>
> I notice this was also discussed earlier in 10/2015
>
> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/influxdb/wrBOjiZApIY/0wlJDfPlCQAJ
>
> converting tag/field data that is already in python dicts to JSON seems
> pointless, so I'd really like a clean and minimal interface for writing
> points from python.
>
> thanks,
> Anders
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/influxdb/CAPnVNRWhQntvzJs6qjj%2BcAv%3DAX2p%2BKvZAD6%2B%3Df4BxgAD8jMNBA%40mail.gmail.com
> <https://groups.google.com/d/msgid/influxdb/CAPnVNRWhQntvzJs6qjj%2BcAv%3DAX2p%2BKvZAD6%2B%3Df4BxgAD8jMNBA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAD8sRLBzLhQF8ME%3DPpSoFNSayk3dM9QqDEZR2qzDrYU4%2BG%2B1Rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to