Skip to content

Commit

Permalink
feat: Prepare documentation for PandasData frame (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Nov 13, 2019
1 parent 41ee594 commit 3193442
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ InfluxDB 2.0 client features

- Querying data
- using the Flux language
- into csv, raw data, `flux_table <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/flux_table.py#L5>`_ structure
- into csv, raw data, `flux_table <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/flux_table.py#L5>`_ structure, `Pandas DataFrame <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html>`_
- `How to queries <#queries>`_
- Writing data using
- `Line Protocol <https://docs.influxdata.com/influxdb/v1.6/write_protocols/line_protocol_tutorial>`_
Expand Down Expand Up @@ -300,6 +300,7 @@ The result retrieved by `QueryApi <https://github.com/influxdata/influxdb-client
1. Flux data structure: `FluxTable <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/flux_table.py#L5>`_, `FluxColumn <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/flux_table.py#L22>`_ and `FluxRecord <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/flux_table.py#L31>`_
2. `csv.reader <https://docs.python.org/3.4/library/csv.html#reader-objects>`__ which will iterate over CSV lines
3. Raw unprocessed results as a ``str`` iterator
4. `Pandas DataFrame <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html>`_

The API also support streaming ``FluxRecord`` via `query_stream <https://github.com/influxdata/influxdb-client-python/blob/master/influxdb_client/client/query_api.py#L77>`_, see example below:

Expand Down Expand Up @@ -372,6 +373,15 @@ The API also support streaming ``FluxRecord`` via `query_stream <https://github.
"""
client.__del__()
Pandas DataFrame
^^^^^^^^^^^^^^^^
.. marker-pandas-start
.. note::
Note that if a query returns more then one table than the client generates a DataFrame for each of them.

.. marker-pandas-end
Examples
^^^^^^^^

Expand Down
5 changes: 5 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ TasksApi

.. autoclass:: influxdb_client.domain.Task
:members:

DeleteApi
""""""""
.. autoclass:: influxdb_client.DeleteApi
:members:
6 changes: 6 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Query
:start-after: marker-query-start
:end-before: marker-query-end

Pandas DataFrame
^^^^^^^^^^^^^^^^
.. include:: ../README.rst
:start-after: marker-pandas-start
:end-before: marker-pandas-end

Write
^^^^^
.. include:: ../README.rst
Expand Down

0 comments on commit 3193442

Please sign in to comment.