Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Latest commit

 

History

History
77 lines (52 loc) · 1.95 KB

api-documentation.rst

File metadata and controls

77 lines (52 loc) · 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='127.0.0.1', port=8086, database='dbname')
client = InfluxDBClient(host='127.0.0.1', port=8086, username='root', password='root', database='dbname')

# using UDP
client = InfluxDBClient(host='127.0.0.1', 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='127.0.0.1', port=8086, username='root', password='root', database='dbname')

Note

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

.. currentmodule:: influxdb.InfluxDBClient
.. autoclass:: influxdb.InfluxDBClient
    :members:
    :undoc-members:

.. currentmodule:: influxdb.DataFrameClient
.. autoclass:: influxdb.DataFrameClient
    :members:
    :undoc-members:

.. currentmodule:: influxdb.SeriesHelper
.. autoclass:: influxdb.SeriesHelper
    :members:
    :undoc-members:

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

.. currentmodule:: influxdb.ResultSet
.. autoclass:: influxdb.resultset.ResultSet
    :members:
    :undoc-members: