python-openobserve 0.5.0__tar.gz → 0.5.1__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.
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/PKG-INFO +13 -11
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/README.md +1 -0
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/pyproject.toml +16 -17
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/python_openobserve/openobserve.py +9 -68
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/LICENSES/CC-BY-4.0.txt +0 -0
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/LICENSES/CC-BY-SA-4.0.txt +0 -0
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/LICENSES/GPL-3.0-or-later.txt +0 -0
- {python_openobserve-0.5.0 → python_openobserve-0.5.1}/python_openobserve/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-openobserve
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: OpenObserve client for Python
|
|
5
5
|
License-File: LICENSES/CC-BY-4.0.txt
|
|
6
6
|
License-File: LICENSES/CC-BY-SA-4.0.txt
|
|
@@ -8,21 +8,20 @@ License-File: LICENSES/GPL-3.0-or-later.txt
|
|
|
8
8
|
Keywords: openobserve,elasticsearch,logging,unstructured data
|
|
9
9
|
Author: Justin Guese
|
|
10
10
|
Author-email: guese.justin@gmail.com
|
|
11
|
-
Requires-Python: >=3.10,<3.
|
|
11
|
+
Requires-Python: >=3.10,<3.15
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Provides-Extra: ci
|
|
14
14
|
Provides-Extra: docs
|
|
15
|
-
Provides-Extra: fireducks
|
|
16
15
|
Provides-Extra: pandas
|
|
17
16
|
Provides-Extra: polars
|
|
18
17
|
Provides-Extra: tests
|
|
19
|
-
Requires-Dist: cryptography (>=
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
18
|
+
Requires-Dist: cryptography (>=48.0.1,<48.1.0)
|
|
19
|
+
Requires-Dist: h11 (>=0.16.0,<0.17.0)
|
|
20
|
+
Requires-Dist: httpcore (>=1.0.9,<1.1.0)
|
|
22
21
|
Requires-Dist: httpx (>=0.28,<1.0)
|
|
23
22
|
Requires-Dist: jmespath (==1.0.1) ; extra == "ci"
|
|
24
23
|
Requires-Dist: jmespath (==1.0.1) ; extra == "tests"
|
|
25
|
-
Requires-Dist: memray (==1.
|
|
24
|
+
Requires-Dist: memray (==1.19.3) ; extra == "ci"
|
|
26
25
|
Requires-Dist: mkdocs (==1.6.1) ; extra == "docs"
|
|
27
26
|
Requires-Dist: mkdocs-material (==9.6.15) ; extra == "docs"
|
|
28
27
|
Requires-Dist: mkdocstrings (==0.29.1) ; extra == "docs"
|
|
@@ -34,13 +33,15 @@ Requires-Dist: pandas-stubs (==2.2.2.240807) ; extra == "ci"
|
|
|
34
33
|
Requires-Dist: polars (==1.30.0) ; extra == "polars"
|
|
35
34
|
Requires-Dist: protobuf (>=6.33.5)
|
|
36
35
|
Requires-Dist: pydantic (>=2.10,<3.0)
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist: pytest (==
|
|
36
|
+
Requires-Dist: pyjwt (>=2.12.1,<3.0.0)
|
|
37
|
+
Requires-Dist: pytest (==9.0.3) ; extra == "ci"
|
|
38
|
+
Requires-Dist: pytest (==9.0.3) ; extra == "tests"
|
|
39
39
|
Requires-Dist: pytest-cov (==6.0.0) ; extra == "ci"
|
|
40
40
|
Requires-Dist: pytest-memray (==1.7.0) ; extra == "ci"
|
|
41
|
-
Requires-Dist: python-dotenv (==1.
|
|
42
|
-
Requires-Dist: python-dotenv (==1.
|
|
41
|
+
Requires-Dist: python-dotenv (==1.2.2) ; extra == "ci"
|
|
42
|
+
Requires-Dist: python-dotenv (==1.2.2) ; extra == "tests"
|
|
43
43
|
Requires-Dist: python-multipart (>=0.0.22)
|
|
44
|
+
Requires-Dist: requests (>=2.33.0,<3.0.0)
|
|
44
45
|
Requires-Dist: sqlglot (>=26.4.0,<26.5.0)
|
|
45
46
|
Requires-Dist: types-jmespath (==1.0.2.20240106) ; extra == "ci"
|
|
46
47
|
Project-URL: Homepage, https://github.com/JustinGuese/python-openobserve
|
|
@@ -56,6 +57,7 @@ Description-Content-Type: text/markdown
|
|
|
56
57
|
|
|
57
58
|
[](https://github.com/JustinGuese/python-openobserve/actions?query=branch%3Amain)
|
|
58
59
|
[](https://pepy.tech/projects/python-openobserve)
|
|
60
|
+
<!-- markdown-link-check-disable-next-line -->
|
|
59
61
|
[](https://python-openobserve.readthedocs.org/en/latest/)
|
|
60
62
|
[](https://scorecard.dev/viewer/?uri=github.com/JustinGuese/python-openobserve)
|
|
61
63
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
[](https://github.com/JustinGuese/python-openobserve/actions?query=branch%3Amain)
|
|
9
9
|
[](https://pepy.tech/projects/python-openobserve)
|
|
10
|
+
<!-- markdown-link-check-disable-next-line -->
|
|
10
11
|
[](https://python-openobserve.readthedocs.org/en/latest/)
|
|
11
12
|
[](https://scorecard.dev/viewer/?uri=github.com/JustinGuese/python-openobserve)
|
|
12
13
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "python-openobserve"
|
|
6
|
-
version = "0.5.
|
|
6
|
+
version = "0.5.1"
|
|
7
7
|
description = "OpenObserve client for Python"
|
|
8
8
|
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.10,<3.
|
|
9
|
+
requires-python = ">=3.10,<3.15"
|
|
10
10
|
license-files = [
|
|
11
11
|
"LICENSES/CC-BY-4.0.txt",
|
|
12
12
|
"LICENSES/CC-BY-SA-4.0.txt",
|
|
@@ -19,12 +19,16 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
dependencies = [
|
|
22
|
-
"cryptography>=
|
|
22
|
+
"cryptography (>=48.0.1,<48.1.0)",
|
|
23
|
+
"h11~=0.16.0",
|
|
24
|
+
"httpcore~=1.0.9",
|
|
23
25
|
"httpx~=0.28",
|
|
24
26
|
"protobuf>=6.33.5",
|
|
25
27
|
"pydantic~=2.10",
|
|
26
28
|
"python-multipart>=0.0.22",
|
|
27
29
|
"sqlglot~=26.4.0",
|
|
30
|
+
"pyjwt (>=2.12.1,<3.0.0)",
|
|
31
|
+
"requests (>=2.33.0,<3.0.0)",
|
|
28
32
|
]
|
|
29
33
|
|
|
30
34
|
[project.urls]
|
|
@@ -37,32 +41,30 @@ python_openobserve = "python_openobserve:openobserve"
|
|
|
37
41
|
[project.optional-dependencies]
|
|
38
42
|
ci = [
|
|
39
43
|
"jmespath==1.0.1",
|
|
40
|
-
"memray==1.
|
|
44
|
+
"memray==1.19.3",
|
|
41
45
|
"pytest-memray==1.7.0",
|
|
42
46
|
"mypy==1.15.0",
|
|
43
47
|
"mypy-extensions==1.0.0",
|
|
44
48
|
"pandas==2.2.3",
|
|
45
49
|
"pandas-stubs==2.2.2.240807",
|
|
46
|
-
"pytest==
|
|
50
|
+
"pytest==9.0.3",
|
|
47
51
|
"pytest-cov==6.0.0",
|
|
48
|
-
"python-dotenv==1.
|
|
52
|
+
"python-dotenv==1.2.2",
|
|
49
53
|
"types-jmespath==1.0.2.20240106",
|
|
50
|
-
"guarddog==2.7.1",
|
|
51
54
|
]
|
|
52
55
|
docs = [
|
|
53
56
|
"mkdocs==1.6.1",
|
|
54
57
|
"mkdocs-material==9.6.15",
|
|
55
58
|
"mkdocstrings==0.29.1",
|
|
56
59
|
]
|
|
57
|
-
tests = ["pytest==
|
|
60
|
+
tests = ["pytest==9.0.3", "jmespath==1.0.1", "python-dotenv==1.2.2"]
|
|
58
61
|
pandas = ["pandas>=2.2"]
|
|
59
62
|
polars = ["polars==1.30.0"]
|
|
60
|
-
fireducks = ["fireducks==1.4.4"]
|
|
61
63
|
|
|
62
64
|
[tool.poetry.group.test.dependencies]
|
|
63
|
-
pytest = "
|
|
65
|
+
pytest = "9.0.3"
|
|
64
66
|
jmespath = "1.0.1"
|
|
65
|
-
python-dotenv = "1.
|
|
67
|
+
python-dotenv = "1.2.2"
|
|
66
68
|
|
|
67
69
|
[tool.poetry.group.docs.dependencies]
|
|
68
70
|
mkdocs = "1.6.1"
|
|
@@ -71,26 +73,23 @@ mkdocstrings = "0.29.1"
|
|
|
71
73
|
|
|
72
74
|
[tool.poetry.group.ci.dependencies]
|
|
73
75
|
jmespath = "1.0.1"
|
|
74
|
-
memray = "1.
|
|
76
|
+
memray = "1.19.3"
|
|
75
77
|
pytest-memray = "1.7.0"
|
|
76
78
|
mypy = "1.15.0"
|
|
77
79
|
mypy-extensions = "1.0.0"
|
|
78
80
|
pandas = "2.2.3"
|
|
79
81
|
openpyxl = "3.1.5"
|
|
80
82
|
pandas-stubs = "2.2.2.240807"
|
|
81
|
-
pytest = "
|
|
83
|
+
pytest = "9.0.3"
|
|
82
84
|
pytest-cov = "6.0.0"
|
|
83
|
-
python-dotenv = "1.
|
|
85
|
+
python-dotenv = "1.2.2"
|
|
84
86
|
types-jmespath = "1.0.2.20240106"
|
|
85
|
-
guarddog = "2.7.1"
|
|
86
87
|
|
|
87
88
|
[tool.poetry.group.pandas.dependencies]
|
|
88
89
|
pandas = ">2.2"
|
|
89
90
|
|
|
90
91
|
[tool.poetry.group.polars.dependencies]
|
|
91
92
|
polars = "1.30.0"
|
|
92
|
-
[tool.poetry.group.fireducks.dependencies]
|
|
93
|
-
fireducks = "1.4.4"
|
|
94
93
|
|
|
95
94
|
[build-system]
|
|
96
95
|
requires = ["poetry-core"]
|
|
@@ -40,14 +40,6 @@ except ImportError:
|
|
|
40
40
|
print("Can't import polars. some functions may be unavailable.")
|
|
41
41
|
HAVE_MODULE_POLARS = False
|
|
42
42
|
|
|
43
|
-
try:
|
|
44
|
-
import fireducks # type: ignore
|
|
45
|
-
|
|
46
|
-
HAVE_MODULE_FIREDUCKS = True
|
|
47
|
-
except ImportError:
|
|
48
|
-
print("Can't import fireducks. Some functions may be unavailable.")
|
|
49
|
-
HAVE_MODULE_FIREDUCKS = False
|
|
50
|
-
|
|
51
43
|
key_mapping = {
|
|
52
44
|
"dashboards": "dashboards",
|
|
53
45
|
"users": "data",
|
|
@@ -223,10 +215,10 @@ class OpenObserve:
|
|
|
223
215
|
)
|
|
224
216
|
response_json = self._handle_response(res, "index")
|
|
225
217
|
|
|
226
|
-
if response_json["status"][0]["failed"] > 0: # type:ignore[call-overload]
|
|
218
|
+
if response_json["status"][0]["failed"] > 0: # type: ignore[call-overload]
|
|
227
219
|
raise Exception(
|
|
228
220
|
"Openobserve index failed. "
|
|
229
|
-
f"{response_json['status'][0]['error']}" # type:ignore[call-overload]
|
|
221
|
+
f"{response_json['status'][0]['error']}" # type: ignore[call-overload]
|
|
230
222
|
f". document: {document}"
|
|
231
223
|
)
|
|
232
224
|
return response_json
|
|
@@ -297,7 +289,7 @@ class OpenObserve:
|
|
|
297
289
|
)
|
|
298
290
|
|
|
299
291
|
response_json = self._handle_response(res, "search")
|
|
300
|
-
res_hits = response_json["hits"] # type:ignore[call-overload]
|
|
292
|
+
res_hits = response_json["hits"] # type: ignore[call-overload]
|
|
301
293
|
self._debug(res_hits, verbosity, 3)
|
|
302
294
|
|
|
303
295
|
if timestamp_conversion_auto or timestamp_columns is not None:
|
|
@@ -454,57 +446,6 @@ class OpenObserve:
|
|
|
454
446
|
) from err
|
|
455
447
|
return df_res
|
|
456
448
|
|
|
457
|
-
def search2df_fireducks(
|
|
458
|
-
self,
|
|
459
|
-
sql: str,
|
|
460
|
-
*,
|
|
461
|
-
start_time: Union[datetime, int] = 0,
|
|
462
|
-
end_time: Union[datetime, int] = 0,
|
|
463
|
-
verbosity: int = 0,
|
|
464
|
-
timeout: int = 300,
|
|
465
|
-
timestamp_conversion_auto: bool = False,
|
|
466
|
-
timestamp_columns: Union[List[str], None] = None,
|
|
467
|
-
) -> fireducks.core.pandas.DataFrame:
|
|
468
|
-
"""
|
|
469
|
-
OpenObserve search function with fireducks df output
|
|
470
|
-
|
|
471
|
-
Args:
|
|
472
|
-
sql: input sql query
|
|
473
|
-
start_time: start of search interval, either datetime, either int/epoch
|
|
474
|
-
end_time: end of search interval, either datetime, either int/epoch
|
|
475
|
-
verbosity: how verbose to run from 0/less to 5/more
|
|
476
|
-
timeout: http timeout
|
|
477
|
-
timestamp_conversion_auto: try to convert automatically column containing time as name
|
|
478
|
-
timestamp_columns: convert given columns to timestamp
|
|
479
|
-
"""
|
|
480
|
-
res_json_hits = self.search(
|
|
481
|
-
sql,
|
|
482
|
-
start_time=start_time,
|
|
483
|
-
end_time=end_time,
|
|
484
|
-
verbosity=verbosity,
|
|
485
|
-
timeout=timeout,
|
|
486
|
-
timestamp_conversion_auto=timestamp_conversion_auto,
|
|
487
|
-
# leaving conversion to pandas
|
|
488
|
-
# timestamp_columns=timestamp_columns,
|
|
489
|
-
)
|
|
490
|
-
df_res = fireducks.core.pandas.json_normalize(res_json_hits)
|
|
491
|
-
|
|
492
|
-
if timestamp_columns is not None:
|
|
493
|
-
for col in list(
|
|
494
|
-
set(df_res.columns) & set(["_timestamp"] + timestamp_columns)
|
|
495
|
-
):
|
|
496
|
-
try:
|
|
497
|
-
# ensure timestamp format
|
|
498
|
-
if col in ["_timestamp"] + timestamp_columns:
|
|
499
|
-
df_res[col] = fireducks.pandas.to_datetime(df_res[col])
|
|
500
|
-
except Exception as err:
|
|
501
|
-
raise Exception(
|
|
502
|
-
err,
|
|
503
|
-
"query",
|
|
504
|
-
f"query column type conversion: {col} -> {df_res[col]}",
|
|
505
|
-
) from err
|
|
506
|
-
return df_res
|
|
507
|
-
|
|
508
449
|
# pylint: disable=too-many-branches,too-many-locals
|
|
509
450
|
def export_objects_split(
|
|
510
451
|
self,
|
|
@@ -669,14 +610,14 @@ class OpenObserve:
|
|
|
669
610
|
name: [
|
|
670
611
|
api_path,
|
|
671
612
|
self.list_objects(api_path, verbosity=verbosity),
|
|
672
|
-
] # type:ignore[misc]
|
|
613
|
+
] # type: ignore[misc]
|
|
673
614
|
for name, api_path in object_types.items()
|
|
674
615
|
}
|
|
675
616
|
|
|
676
617
|
for name, object_data in data.items():
|
|
677
618
|
self.export_objects_split(
|
|
678
|
-
object_data[0], # type:ignore[arg-type]
|
|
679
|
-
object_data[1], # type:ignore[arg-type]
|
|
619
|
+
object_data[0], # type: ignore[arg-type]
|
|
620
|
+
object_data[1], # type: ignore[arg-type]
|
|
680
621
|
file_path,
|
|
681
622
|
verbosity=verbosity,
|
|
682
623
|
strip=strip,
|
|
@@ -688,7 +629,7 @@ class OpenObserve:
|
|
|
688
629
|
data = {
|
|
689
630
|
name: self.list_objects(
|
|
690
631
|
api_path, verbosity=verbosity
|
|
691
|
-
) # type:ignore[misc]
|
|
632
|
+
) # type: ignore[misc]
|
|
692
633
|
for name, api_path in object_types.items()
|
|
693
634
|
}
|
|
694
635
|
|
|
@@ -780,7 +721,7 @@ class OpenObserve:
|
|
|
780
721
|
count_update = 0
|
|
781
722
|
current = self.list_objects(object_type, verbosity)
|
|
782
723
|
self._debug(f"Create/Update by name objects list: {current}", verbosity, 4)
|
|
783
|
-
for obj in current[key]: # type:ignore[call-overload]
|
|
724
|
+
for obj in current[key]: # type: ignore[call-overload]
|
|
784
725
|
if key_name in obj and object_name.strip() == obj[key_name].strip():
|
|
785
726
|
if overwrite:
|
|
786
727
|
object_json[key_id] = obj[key_id]
|
|
@@ -843,7 +784,7 @@ class OpenObserve:
|
|
|
843
784
|
count_delete = 0
|
|
844
785
|
current = self.list_objects(object_type, verbosity)
|
|
845
786
|
self._debug(f"Delete by name objects list: {current}", verbosity, 3)
|
|
846
|
-
for obj in current[key]: # type:ignore[call-overload]
|
|
787
|
+
for obj in current[key]: # type: ignore[call-overload]
|
|
847
788
|
if "name" in obj and object_name == obj[key_name]:
|
|
848
789
|
self._debug(f"Delete by name matching object: {obj}", verbosity)
|
|
849
790
|
self.delete_object(object_type, obj[key_id], verbosity)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|