Skip to content
Branch: master
Find file Copy path
Find file Copy path
7 contributors

Users who have contributed to this file

@aviau @areski @timtroendle @sblondon @gaker @georgijd @agnivade
78 lines (52 sloc) 1.95 KB

API Documentation

To connect to a InfluxDB, you must create a :py:class:`~influxdb.InfluxDBClient` object. The default configuration connects to InfluxDB on localhost with the default ports. The below instantiation statements are all equivalent:

from influxdb import InfluxDBClient

# using Http
client = InfluxDBClient(database='dbname')
client = InfluxDBClient(host='', port=8086, database='dbname')
client = InfluxDBClient(host='', port=8086, username='root', password='root', database='dbname')

# using UDP
client = InfluxDBClient(host='', database='dbname', use_udp=True, udp_port=4444)

To write pandas DataFrames or to read data into a pandas DataFrame, use a :py:class:`~influxdb.DataFrameClient` object. These clients are initiated in the same way as the :py:class:`~influxdb.InfluxDBClient`:

from influxdb import DataFrameClient

client = DataFrameClient(host='', port=8086, username='root', password='root', database='dbname')


Only when using UDP (use_udp=True) the connection is established.


.. currentmodule:: influxdb.InfluxDBClient
.. autoclass:: influxdb.InfluxDBClient


.. currentmodule:: influxdb.DataFrameClient
.. autoclass:: influxdb.DataFrameClient


.. currentmodule:: influxdb.SeriesHelper
.. autoclass:: influxdb.SeriesHelper


See the :ref:`resultset` page for more information.

.. currentmodule:: influxdb.ResultSet
.. autoclass:: influxdb.resultset.ResultSet
You can’t perform that action at this time.