influxdb3-python 0.12.0__tar.gz → 0.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/basic_ssl_example.py +0 -2
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/batching_example.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/cloud_dedicated_query.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/cloud_dedicated_write.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/config.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/flight_options_example.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/handle_http_error.py +0 -1
- influxdb3_python-0.14.0/Examples/handle_query_error.py +33 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/pandas_write.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/query_async.py +0 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/query_type.py +0 -1
- {influxdb3_python-0.12.0/influxdb3_python.egg-info → influxdb3_python-0.14.0}/PKG-INFO +29 -13
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/README.md +27 -11
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0/influxdb3_python.egg-info}/PKG-INFO +29 -13
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb3_python.egg-info/SOURCES.txt +8 -2
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb3_python.egg-info/requires.txt +1 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/__init__.py +165 -9
- influxdb3_python-0.14.0/influxdb_client_3/exceptions/__init__.py +3 -0
- {influxdb3_python-0.12.0/influxdb_client_3/write_client/client → influxdb3_python-0.14.0/influxdb_client_3/exceptions}/exceptions.py +35 -2
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/query/query_api.py +11 -17
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/version.py +1 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/__init__.py +0 -10
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/_sync/api_client.py +43 -25
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/_sync/rest.py +0 -20
- {influxdb3_python-0.12.0/influxdb_client_3/write_client/client/write → influxdb3_python-0.14.0/influxdb_client_3/write_client/client}/__init__.py +0 -10
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/_base.py +12 -8
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/influxdb_client.py +9 -5
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/util/multiprocessing_helper.py +1 -1
- {influxdb3_python-0.12.0/influxdb_client_3/write_client/client → influxdb3_python-0.14.0/influxdb_client_3/write_client/client/write}/__init__.py +0 -10
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/write/retry.py +1 -1
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/write_api.py +33 -8
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/configuration.py +10 -24
- influxdb3_python-0.14.0/influxdb_client_3/write_client/domain/__init__.py +10 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/domain/write_precision.py +0 -16
- influxdb3_python-0.14.0/influxdb_client_3/write_client/domain/write_precision_converter.py +30 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/rest.py +1 -15
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/service/__init__.py +0 -12
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/service/signin_service.py +1 -17
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/service/signout_service.py +1 -17
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/service/write_service.py +52 -42
- influxdb3_python-0.14.0/pyproject.toml +3 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/setup.py +1 -2
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_api_client.py +23 -1
- influxdb3_python-0.14.0/tests/test_influxdb_client_3.py +231 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_influxdb_client_3_integration.py +3 -3
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_polars.py +12 -4
- influxdb3_python-0.14.0/tests/test_write_local_server.py +129 -0
- influxdb3_python-0.14.0/tests/test_write_precision_converter.py +37 -0
- influxdb3_python-0.12.0/influxdb_client_3/write_client/domain/__init__.py +0 -19
- influxdb3_python-0.12.0/tests/test_influxdb_client_3.py +0 -79
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/Examples/__init__.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/LICENSE +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb3_python.egg-info/dependency_links.txt +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb3_python.egg-info/top_level.txt +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/py.typed +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/query/__init__.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/read_file.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/_sync/__init__.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/logging_handler.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/util/__init__.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/util/date_utils.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/util/date_utils_pandas.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/util/helpers.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/warnings.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/write/dataframe_serializer.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/write/point.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/client/write/polars_dataframe_serializer.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/extras.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/influxdb_client_3/write_client/service/_base_service.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/setup.cfg +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_dataframe_serializer.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_date_helper.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_deep_merge.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_merge_options.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_point.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_query.py +0 -0
- {influxdb3_python-0.12.0 → influxdb3_python-0.14.0}/tests/test_write_file.py +0 -0
|
@@ -70,7 +70,6 @@ def write_and_query_with_explicit_sys_cert(conf):
|
|
|
70
70
|
print("\nwrite and query with typical linux system cert\n")
|
|
71
71
|
with InfluxDBClient3(token=conf.token,
|
|
72
72
|
host=conf.host,
|
|
73
|
-
org=conf.org,
|
|
74
73
|
database=conf.database,
|
|
75
74
|
ssl_ca_cert="/etc/ssl/certs/ca-certificates.crt",
|
|
76
75
|
verify_ssl=True) as _client:
|
|
@@ -90,7 +89,6 @@ def query_with_verify_ssl_off(conf, cert):
|
|
|
90
89
|
# Switch verify_ssl to True to throw SSL_ERROR_SSL
|
|
91
90
|
with InfluxDBClient3(token=conf.token,
|
|
92
91
|
host=conf.host,
|
|
93
|
-
org=conf.org,
|
|
94
92
|
database=conf.database,
|
|
95
93
|
ssl_ca_cert=cert,
|
|
96
94
|
verify_ssl=False) as _client:
|
|
@@ -6,7 +6,6 @@ class Config:
|
|
|
6
6
|
def __init__(self):
|
|
7
7
|
self.host = os.getenv('INFLUXDB_HOST') or 'https://us-east-1-1.aws.cloud2.influxdata.com/'
|
|
8
8
|
self.token = os.getenv('INFLUXDB_TOKEN') or 'my-token'
|
|
9
|
-
self.org = os.getenv('INFLUXDB_ORG') or 'my-org'
|
|
10
9
|
self.database = os.getenv('INFLUXDB_DATABASE') or 'my-db'
|
|
11
10
|
|
|
12
11
|
def __str__(self):
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Demonstrates handling error when querying InfluxDB.
|
|
3
|
+
"""
|
|
4
|
+
import logging
|
|
5
|
+
from config import Config
|
|
6
|
+
from influxdb_client_3.exceptions import InfluxDB3ClientQueryError
|
|
7
|
+
|
|
8
|
+
import influxdb_client_3 as InfluxDBClient3
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def main() -> None:
|
|
12
|
+
"""
|
|
13
|
+
Main function
|
|
14
|
+
:return:
|
|
15
|
+
"""
|
|
16
|
+
config = Config()
|
|
17
|
+
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
|
|
18
|
+
|
|
19
|
+
client = InfluxDBClient3.InfluxDBClient3(
|
|
20
|
+
host=config.host,
|
|
21
|
+
token=config.token,
|
|
22
|
+
database=config.database
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
try:
|
|
26
|
+
# Select from a bucket that doesn't exist
|
|
27
|
+
client.query("Select a from cpu11")
|
|
28
|
+
except InfluxDB3ClientQueryError as e:
|
|
29
|
+
logging.log(logging.ERROR, e.message)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
if __name__ == "__main__":
|
|
33
|
+
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: influxdb3-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Community Python client for InfluxDB 3.0
|
|
5
5
|
Home-page: https://github.com/InfluxCommunity/influxdb3-python
|
|
6
6
|
Author: InfluxData
|
|
@@ -20,7 +20,6 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: reactivex>=4.0.4
|
|
21
21
|
Requires-Dist: certifi>=14.05.14
|
|
22
22
|
Requires-Dist: python_dateutil>=2.5.3
|
|
23
|
-
Requires-Dist: setuptools>=21.0.0
|
|
24
23
|
Requires-Dist: urllib3>=1.26.0
|
|
25
24
|
Requires-Dist: pyarrow>=8.0.0
|
|
26
25
|
Provides-Extra: pandas
|
|
@@ -33,6 +32,7 @@ Requires-Dist: polars; extra == "dataframe"
|
|
|
33
32
|
Provides-Extra: test
|
|
34
33
|
Requires-Dist: pytest; extra == "test"
|
|
35
34
|
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: pytest-httpserver; extra == "test"
|
|
36
36
|
Dynamic: author
|
|
37
37
|
Dynamic: author-email
|
|
38
38
|
Dynamic: classifier
|
|
@@ -45,6 +45,7 @@ Dynamic: requires-dist
|
|
|
45
45
|
Dynamic: requires-python
|
|
46
46
|
Dynamic: summary
|
|
47
47
|
|
|
48
|
+
<!--home-start-->
|
|
48
49
|
<p align="center">
|
|
49
50
|
<img src="https://github.com/InfluxCommunity/influxdb3-python/blob/main/python-logo.png?raw=true" alt="Your Image" width="150px">
|
|
50
51
|
</p>
|
|
@@ -95,7 +96,7 @@ Note: This does not include Pandas support. If you would like to use key feature
|
|
|
95
96
|
*Note: Please make sure you are using 3.6 or above. For the best performance use 3.11+*
|
|
96
97
|
|
|
97
98
|
# Usage
|
|
98
|
-
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
99
|
+
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
99
100
|
|
|
100
101
|
## Importing the Module
|
|
101
102
|
```python
|
|
@@ -104,13 +105,11 @@ from influxdb_client_3 import InfluxDBClient3, Point
|
|
|
104
105
|
|
|
105
106
|
## Initialization
|
|
106
107
|
If you are using InfluxDB Cloud, then you should note that:
|
|
107
|
-
1.
|
|
108
|
-
2. Use bucket name for the `database` argument.
|
|
108
|
+
1. Use bucket name for `database` or `bucket` in function argument.
|
|
109
109
|
|
|
110
110
|
```python
|
|
111
111
|
client = InfluxDBClient3(token="your-token",
|
|
112
112
|
host="your-host",
|
|
113
|
-
org="your-org",
|
|
114
113
|
database="your-database")
|
|
115
114
|
```
|
|
116
115
|
|
|
@@ -171,7 +170,6 @@ wco = write_client_options(success_callback=callback.success,
|
|
|
171
170
|
with InfluxDBClient3.InfluxDBClient3(
|
|
172
171
|
token="INSERT_TOKEN",
|
|
173
172
|
host="eu-central-1-1.aws.cloud2.influxdata.com",
|
|
174
|
-
org="6a841c0c08328fb1",
|
|
175
173
|
database="python", write_client_options=wco) as client:
|
|
176
174
|
|
|
177
175
|
|
|
@@ -218,27 +216,24 @@ Install `certifi`
|
|
|
218
216
|
pip install certifi
|
|
219
217
|
```
|
|
220
218
|
Next include certifi within the flight client options:
|
|
219
|
+
|
|
221
220
|
```python
|
|
221
|
+
import certifi
|
|
222
|
+
|
|
222
223
|
import influxdb_client_3 as InfluxDBClient3
|
|
223
|
-
import pandas as pd
|
|
224
|
-
import numpy as np
|
|
225
224
|
from influxdb_client_3 import flight_client_options
|
|
226
|
-
import certifi
|
|
227
225
|
|
|
228
226
|
fh = open(certifi.where(), "r")
|
|
229
227
|
cert = fh.read()
|
|
230
228
|
fh.close()
|
|
231
229
|
|
|
232
|
-
|
|
233
230
|
client = InfluxDBClient3.InfluxDBClient3(
|
|
234
231
|
token="",
|
|
235
232
|
host="b0c7cce5-8dbc-428e-98c6-7f996fb96467.a.influxdb.io",
|
|
236
|
-
org="6a841c0c08328fb1",
|
|
237
233
|
database="flightdemo",
|
|
238
234
|
flight_client_options=flight_client_options(
|
|
239
235
|
tls_root_certs=cert))
|
|
240
236
|
|
|
241
|
-
|
|
242
237
|
table = client.query(
|
|
243
238
|
query="SELECT * FROM flight WHERE time > now() - 4h",
|
|
244
239
|
language="influxql")
|
|
@@ -246,3 +241,24 @@ table = client.query(
|
|
|
246
241
|
print(table.to_pandas())
|
|
247
242
|
```
|
|
248
243
|
You may also include your own root certificate via this manor aswell.
|
|
244
|
+
|
|
245
|
+
# Contributing
|
|
246
|
+
|
|
247
|
+
Tests are run using `pytest`.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Clone the repository
|
|
251
|
+
git clone https://github.com/InfluxCommunity/influxdb3-python
|
|
252
|
+
cd influxdb3-python
|
|
253
|
+
|
|
254
|
+
# Create a virtual environment and activate it
|
|
255
|
+
python3 -m venv .venv
|
|
256
|
+
source .venv/bin/activate
|
|
257
|
+
|
|
258
|
+
# Install the package and its dependencies
|
|
259
|
+
pip install -e .[pandas,polars,dataframe,test]
|
|
260
|
+
|
|
261
|
+
# Run the tests
|
|
262
|
+
python -m pytest .
|
|
263
|
+
```
|
|
264
|
+
<!--home-end-->
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!--home-start-->
|
|
1
2
|
<p align="center">
|
|
2
3
|
<img src="https://github.com/InfluxCommunity/influxdb3-python/blob/main/python-logo.png?raw=true" alt="Your Image" width="150px">
|
|
3
4
|
</p>
|
|
@@ -48,7 +49,7 @@ Note: This does not include Pandas support. If you would like to use key feature
|
|
|
48
49
|
*Note: Please make sure you are using 3.6 or above. For the best performance use 3.11+*
|
|
49
50
|
|
|
50
51
|
# Usage
|
|
51
|
-
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
52
|
+
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
52
53
|
|
|
53
54
|
## Importing the Module
|
|
54
55
|
```python
|
|
@@ -57,13 +58,11 @@ from influxdb_client_3 import InfluxDBClient3, Point
|
|
|
57
58
|
|
|
58
59
|
## Initialization
|
|
59
60
|
If you are using InfluxDB Cloud, then you should note that:
|
|
60
|
-
1.
|
|
61
|
-
2. Use bucket name for the `database` argument.
|
|
61
|
+
1. Use bucket name for `database` or `bucket` in function argument.
|
|
62
62
|
|
|
63
63
|
```python
|
|
64
64
|
client = InfluxDBClient3(token="your-token",
|
|
65
65
|
host="your-host",
|
|
66
|
-
org="your-org",
|
|
67
66
|
database="your-database")
|
|
68
67
|
```
|
|
69
68
|
|
|
@@ -124,7 +123,6 @@ wco = write_client_options(success_callback=callback.success,
|
|
|
124
123
|
with InfluxDBClient3.InfluxDBClient3(
|
|
125
124
|
token="INSERT_TOKEN",
|
|
126
125
|
host="eu-central-1-1.aws.cloud2.influxdata.com",
|
|
127
|
-
org="6a841c0c08328fb1",
|
|
128
126
|
database="python", write_client_options=wco) as client:
|
|
129
127
|
|
|
130
128
|
|
|
@@ -171,27 +169,24 @@ Install `certifi`
|
|
|
171
169
|
pip install certifi
|
|
172
170
|
```
|
|
173
171
|
Next include certifi within the flight client options:
|
|
172
|
+
|
|
174
173
|
```python
|
|
174
|
+
import certifi
|
|
175
|
+
|
|
175
176
|
import influxdb_client_3 as InfluxDBClient3
|
|
176
|
-
import pandas as pd
|
|
177
|
-
import numpy as np
|
|
178
177
|
from influxdb_client_3 import flight_client_options
|
|
179
|
-
import certifi
|
|
180
178
|
|
|
181
179
|
fh = open(certifi.where(), "r")
|
|
182
180
|
cert = fh.read()
|
|
183
181
|
fh.close()
|
|
184
182
|
|
|
185
|
-
|
|
186
183
|
client = InfluxDBClient3.InfluxDBClient3(
|
|
187
184
|
token="",
|
|
188
185
|
host="b0c7cce5-8dbc-428e-98c6-7f996fb96467.a.influxdb.io",
|
|
189
|
-
org="6a841c0c08328fb1",
|
|
190
186
|
database="flightdemo",
|
|
191
187
|
flight_client_options=flight_client_options(
|
|
192
188
|
tls_root_certs=cert))
|
|
193
189
|
|
|
194
|
-
|
|
195
190
|
table = client.query(
|
|
196
191
|
query="SELECT * FROM flight WHERE time > now() - 4h",
|
|
197
192
|
language="influxql")
|
|
@@ -199,3 +194,24 @@ table = client.query(
|
|
|
199
194
|
print(table.to_pandas())
|
|
200
195
|
```
|
|
201
196
|
You may also include your own root certificate via this manor aswell.
|
|
197
|
+
|
|
198
|
+
# Contributing
|
|
199
|
+
|
|
200
|
+
Tests are run using `pytest`.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Clone the repository
|
|
204
|
+
git clone https://github.com/InfluxCommunity/influxdb3-python
|
|
205
|
+
cd influxdb3-python
|
|
206
|
+
|
|
207
|
+
# Create a virtual environment and activate it
|
|
208
|
+
python3 -m venv .venv
|
|
209
|
+
source .venv/bin/activate
|
|
210
|
+
|
|
211
|
+
# Install the package and its dependencies
|
|
212
|
+
pip install -e .[pandas,polars,dataframe,test]
|
|
213
|
+
|
|
214
|
+
# Run the tests
|
|
215
|
+
python -m pytest .
|
|
216
|
+
```
|
|
217
|
+
<!--home-end-->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: influxdb3-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Community Python client for InfluxDB 3.0
|
|
5
5
|
Home-page: https://github.com/InfluxCommunity/influxdb3-python
|
|
6
6
|
Author: InfluxData
|
|
@@ -20,7 +20,6 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: reactivex>=4.0.4
|
|
21
21
|
Requires-Dist: certifi>=14.05.14
|
|
22
22
|
Requires-Dist: python_dateutil>=2.5.3
|
|
23
|
-
Requires-Dist: setuptools>=21.0.0
|
|
24
23
|
Requires-Dist: urllib3>=1.26.0
|
|
25
24
|
Requires-Dist: pyarrow>=8.0.0
|
|
26
25
|
Provides-Extra: pandas
|
|
@@ -33,6 +32,7 @@ Requires-Dist: polars; extra == "dataframe"
|
|
|
33
32
|
Provides-Extra: test
|
|
34
33
|
Requires-Dist: pytest; extra == "test"
|
|
35
34
|
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: pytest-httpserver; extra == "test"
|
|
36
36
|
Dynamic: author
|
|
37
37
|
Dynamic: author-email
|
|
38
38
|
Dynamic: classifier
|
|
@@ -45,6 +45,7 @@ Dynamic: requires-dist
|
|
|
45
45
|
Dynamic: requires-python
|
|
46
46
|
Dynamic: summary
|
|
47
47
|
|
|
48
|
+
<!--home-start-->
|
|
48
49
|
<p align="center">
|
|
49
50
|
<img src="https://github.com/InfluxCommunity/influxdb3-python/blob/main/python-logo.png?raw=true" alt="Your Image" width="150px">
|
|
50
51
|
</p>
|
|
@@ -95,7 +96,7 @@ Note: This does not include Pandas support. If you would like to use key feature
|
|
|
95
96
|
*Note: Please make sure you are using 3.6 or above. For the best performance use 3.11+*
|
|
96
97
|
|
|
97
98
|
# Usage
|
|
98
|
-
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
99
|
+
One of the easiest ways to get started is to checkout the ["Pokemon Trainer Cookbook"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
|
|
99
100
|
|
|
100
101
|
## Importing the Module
|
|
101
102
|
```python
|
|
@@ -104,13 +105,11 @@ from influxdb_client_3 import InfluxDBClient3, Point
|
|
|
104
105
|
|
|
105
106
|
## Initialization
|
|
106
107
|
If you are using InfluxDB Cloud, then you should note that:
|
|
107
|
-
1.
|
|
108
|
-
2. Use bucket name for the `database` argument.
|
|
108
|
+
1. Use bucket name for `database` or `bucket` in function argument.
|
|
109
109
|
|
|
110
110
|
```python
|
|
111
111
|
client = InfluxDBClient3(token="your-token",
|
|
112
112
|
host="your-host",
|
|
113
|
-
org="your-org",
|
|
114
113
|
database="your-database")
|
|
115
114
|
```
|
|
116
115
|
|
|
@@ -171,7 +170,6 @@ wco = write_client_options(success_callback=callback.success,
|
|
|
171
170
|
with InfluxDBClient3.InfluxDBClient3(
|
|
172
171
|
token="INSERT_TOKEN",
|
|
173
172
|
host="eu-central-1-1.aws.cloud2.influxdata.com",
|
|
174
|
-
org="6a841c0c08328fb1",
|
|
175
173
|
database="python", write_client_options=wco) as client:
|
|
176
174
|
|
|
177
175
|
|
|
@@ -218,27 +216,24 @@ Install `certifi`
|
|
|
218
216
|
pip install certifi
|
|
219
217
|
```
|
|
220
218
|
Next include certifi within the flight client options:
|
|
219
|
+
|
|
221
220
|
```python
|
|
221
|
+
import certifi
|
|
222
|
+
|
|
222
223
|
import influxdb_client_3 as InfluxDBClient3
|
|
223
|
-
import pandas as pd
|
|
224
|
-
import numpy as np
|
|
225
224
|
from influxdb_client_3 import flight_client_options
|
|
226
|
-
import certifi
|
|
227
225
|
|
|
228
226
|
fh = open(certifi.where(), "r")
|
|
229
227
|
cert = fh.read()
|
|
230
228
|
fh.close()
|
|
231
229
|
|
|
232
|
-
|
|
233
230
|
client = InfluxDBClient3.InfluxDBClient3(
|
|
234
231
|
token="",
|
|
235
232
|
host="b0c7cce5-8dbc-428e-98c6-7f996fb96467.a.influxdb.io",
|
|
236
|
-
org="6a841c0c08328fb1",
|
|
237
233
|
database="flightdemo",
|
|
238
234
|
flight_client_options=flight_client_options(
|
|
239
235
|
tls_root_certs=cert))
|
|
240
236
|
|
|
241
|
-
|
|
242
237
|
table = client.query(
|
|
243
238
|
query="SELECT * FROM flight WHERE time > now() - 4h",
|
|
244
239
|
language="influxql")
|
|
@@ -246,3 +241,24 @@ table = client.query(
|
|
|
246
241
|
print(table.to_pandas())
|
|
247
242
|
```
|
|
248
243
|
You may also include your own root certificate via this manor aswell.
|
|
244
|
+
|
|
245
|
+
# Contributing
|
|
246
|
+
|
|
247
|
+
Tests are run using `pytest`.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Clone the repository
|
|
251
|
+
git clone https://github.com/InfluxCommunity/influxdb3-python
|
|
252
|
+
cd influxdb3-python
|
|
253
|
+
|
|
254
|
+
# Create a virtual environment and activate it
|
|
255
|
+
python3 -m venv .venv
|
|
256
|
+
source .venv/bin/activate
|
|
257
|
+
|
|
258
|
+
# Install the package and its dependencies
|
|
259
|
+
pip install -e .[pandas,polars,dataframe,test]
|
|
260
|
+
|
|
261
|
+
# Run the tests
|
|
262
|
+
python -m pytest .
|
|
263
|
+
```
|
|
264
|
+
<!--home-end-->
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
|
+
pyproject.toml
|
|
3
4
|
setup.py
|
|
4
5
|
Examples/__init__.py
|
|
5
6
|
Examples/basic_ssl_example.py
|
|
@@ -9,6 +10,7 @@ Examples/cloud_dedicated_write.py
|
|
|
9
10
|
Examples/config.py
|
|
10
11
|
Examples/flight_options_example.py
|
|
11
12
|
Examples/handle_http_error.py
|
|
13
|
+
Examples/handle_query_error.py
|
|
12
14
|
Examples/pandas_write.py
|
|
13
15
|
Examples/query_async.py
|
|
14
16
|
Examples/query_type.py
|
|
@@ -21,6 +23,8 @@ influxdb_client_3/__init__.py
|
|
|
21
23
|
influxdb_client_3/py.typed
|
|
22
24
|
influxdb_client_3/read_file.py
|
|
23
25
|
influxdb_client_3/version.py
|
|
26
|
+
influxdb_client_3/exceptions/__init__.py
|
|
27
|
+
influxdb_client_3/exceptions/exceptions.py
|
|
24
28
|
influxdb_client_3/query/__init__.py
|
|
25
29
|
influxdb_client_3/query/query_api.py
|
|
26
30
|
influxdb_client_3/write_client/__init__.py
|
|
@@ -32,7 +36,6 @@ influxdb_client_3/write_client/_sync/api_client.py
|
|
|
32
36
|
influxdb_client_3/write_client/_sync/rest.py
|
|
33
37
|
influxdb_client_3/write_client/client/__init__.py
|
|
34
38
|
influxdb_client_3/write_client/client/_base.py
|
|
35
|
-
influxdb_client_3/write_client/client/exceptions.py
|
|
36
39
|
influxdb_client_3/write_client/client/influxdb_client.py
|
|
37
40
|
influxdb_client_3/write_client/client/logging_handler.py
|
|
38
41
|
influxdb_client_3/write_client/client/warnings.py
|
|
@@ -49,6 +52,7 @@ influxdb_client_3/write_client/client/write/polars_dataframe_serializer.py
|
|
|
49
52
|
influxdb_client_3/write_client/client/write/retry.py
|
|
50
53
|
influxdb_client_3/write_client/domain/__init__.py
|
|
51
54
|
influxdb_client_3/write_client/domain/write_precision.py
|
|
55
|
+
influxdb_client_3/write_client/domain/write_precision_converter.py
|
|
52
56
|
influxdb_client_3/write_client/service/__init__.py
|
|
53
57
|
influxdb_client_3/write_client/service/_base_service.py
|
|
54
58
|
influxdb_client_3/write_client/service/signin_service.py
|
|
@@ -64,4 +68,6 @@ tests/test_merge_options.py
|
|
|
64
68
|
tests/test_point.py
|
|
65
69
|
tests/test_polars.py
|
|
66
70
|
tests/test_query.py
|
|
67
|
-
tests/test_write_file.py
|
|
71
|
+
tests/test_write_file.py
|
|
72
|
+
tests/test_write_local_server.py
|
|
73
|
+
tests/test_write_precision_converter.py
|