diff --git a/docs/source/api-documentation.rst b/docs/source/api-documentation.rst index 35fdb291..49869b65 100644 --- a/docs/source/api-documentation.rst +++ b/docs/source/api-documentation.rst @@ -10,6 +10,10 @@ To connect to a InfluxDB, you must create a connects to InfluxDB on ``localhost`` with the default ports. The below instantiation statements are all equivalent:: + # Set INFLUXDB_NO_DATAFRAME_CLIENT to skip the expensive DataFrameClient + # import in cases where you only need the basic InfluxDBClient. + os.environ["INFLUXDB_NO_DATAFRAME_CLIENT"] = "1" + from influxdb import InfluxDBClient # using Http diff --git a/examples/tutorial.py b/examples/tutorial.py index 12cd49c1..dcd20c8d 100644 --- a/examples/tutorial.py +++ b/examples/tutorial.py @@ -3,6 +3,8 @@ import argparse +import os +os.environ["INFLUXDB_NO_DATAFRAME_CLIENT"] = "1" from influxdb import InfluxDBClient diff --git a/influxdb/__init__.py b/influxdb/__init__.py index 56f2f619..6cd02f48 100644 --- a/influxdb/__init__.py +++ b/influxdb/__init__.py @@ -6,16 +6,21 @@ from __future__ import print_function from __future__ import unicode_literals +import os + from .client import InfluxDBClient -from .dataframe_client import DataFrameClient from .helper import SeriesHelper __all__ = [ 'InfluxDBClient', - 'DataFrameClient', 'SeriesHelper', ] +NO_DATAFRAME_CLIENT = os.environ.get("INFLUXDB_NO_DATAFRAME_CLIENT", "0") +if NO_DATAFRAME_CLIENT.lower() not in ("1", "true"): + from .dataframe_client import DataFrameClient # noqa: F401 unused import + __all__.append("DataFrameClient") + __version__ = '5.3.0'