title: Using Influx with python to write data on DB
body: <p>I'm using the influxdb to try and write some <code>'measurements'</code> on the local influxdb using the influxdb v4.0.0...</p>
  
  <p>I am a litle bit confused because some places say you use a dict or you can use json and or line protocol....</p>
  
  <p>From here <a href="http://influxdb-python.readthedocs.io/en/latest/examples.html#tutorials-pandas" rel="nofollow noreferrer">http://influxdb-python.readthedocs.io/en/latest/examples.html#tutorials-pandas</a> and from here and here <a href="https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py" rel="nofollow noreferrer">https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py</a></p>
  
  <p>1st - <em>Create the DB Object with:</em> </p>
  
  <pre><code>InfluxDBClient('localhost', database='DBNAME')
  </code></pre>
  
  <p>2nd - <em>Create the dict with the data:</em></p>
  
  <pre><code>measurement = {}
  measurement['measurement'] = 'energy'
  measurement['tags'] = {}
  measurement['fields'] = {}
  measurement['tags']['MeterID'] = str(meterId)
  measurement['fields']['Energy_Wh'] = str(eFrame.getReading())
  </code></pre>
  
  <p>3rd - <em>Push data to BD:</em></p>
  
  <pre><code>try:
      self.db.write(measurement)
  except Exception as e:
      print e
  </code></pre>
  
  <p>The program works, but no data is stored in the DB instead my console output is as follows:</p>
  
  <pre><code>2017-01-11 12:41:09,741 - INFO - Saving Meter: MeterId = 09060178
  u'points'
  Meter-ID: 09060178 Energy Value (Wh): 10380300
  {'fields': {'Energy_Wh': '10380300'}, 'tags': {'MeterID': '09060178'}, 'measurement': 'energy'}
  
  1line logger file info
  2line error/Exception
  3line value returned by device
  4line generated dict
  (prints except logging are executed last)
  </code></pre>
  
  <p>I can't seem to find why or what am i writing wrong and what the <code>u'points'</code> error mean... can someone help??</p>