indexify 0.0.25__py3-none-any.whl → 0.0.27__py3-none-any.whl
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.
- indexify/client.py +17 -19
- {indexify-0.0.25.dist-info → indexify-0.0.27.dist-info}/METADATA +1 -1
- {indexify-0.0.25.dist-info → indexify-0.0.27.dist-info}/RECORD +5 -5
- {indexify-0.0.25.dist-info → indexify-0.0.27.dist-info}/LICENSE.txt +0 -0
- {indexify-0.0.25.dist-info → indexify-0.0.27.dist-info}/WHEEL +0 -0
indexify/client.py
CHANGED
@@ -4,7 +4,7 @@ import uuid
|
|
4
4
|
import hashlib
|
5
5
|
import json
|
6
6
|
from collections import namedtuple
|
7
|
-
from .settings import DEFAULT_SERVICE_URL
|
7
|
+
from .settings import DEFAULT_SERVICE_URL, DEFAULT_SERVICE_URL_HTTPS
|
8
8
|
from .extractor import Extractor
|
9
9
|
from .extraction_policy import ExtractionPolicy, ExtractionGraph
|
10
10
|
from .index import Index
|
@@ -108,7 +108,7 @@ class IndexifyClient:
|
|
108
108
|
cert_path: str,
|
109
109
|
key_path: str,
|
110
110
|
ca_bundle_path: Optional[str] = None,
|
111
|
-
service_url: str =
|
111
|
+
service_url: str = DEFAULT_SERVICE_URL_HTTPS,
|
112
112
|
*args,
|
113
113
|
**kwargs,
|
114
114
|
) -> "IndexifyClient":
|
@@ -560,7 +560,7 @@ class IndexifyClient:
|
|
560
560
|
)
|
561
561
|
return response.json()
|
562
562
|
|
563
|
-
def get_extracted_content(self, content_id: str,
|
563
|
+
def get_extracted_content(self, content_id: str, graph_name: str, policy_name: str):
|
564
564
|
"""
|
565
565
|
Get list of child for a given content id and their content up to the specified level.
|
566
566
|
|
@@ -570,20 +570,13 @@ class IndexifyClient:
|
|
570
570
|
"""
|
571
571
|
content_tree = self.get_content_tree(content_id)
|
572
572
|
child_list = []
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
child_id = item["id"]
|
581
|
-
content = self.download_content(child_id)
|
582
|
-
child_list.append({"id": child_id, "content": content})
|
583
|
-
|
584
|
-
traverse_content(child_id, current_level + 1)
|
585
|
-
|
586
|
-
traverse_content(content_id, 0)
|
573
|
+
for item in content_tree["content_tree_metadata"]:
|
574
|
+
if (
|
575
|
+
graph_name in item["extraction_graph_names"]
|
576
|
+
and item["source"] == policy_name
|
577
|
+
):
|
578
|
+
content = self.download_content(item["id"])
|
579
|
+
child_list.append({"id": item["id"], "content": content})
|
587
580
|
|
588
581
|
return child_list
|
589
582
|
|
@@ -631,14 +624,19 @@ class IndexifyClient:
|
|
631
624
|
)
|
632
625
|
return response.json()
|
633
626
|
|
634
|
-
def wait_for_extraction(self,
|
627
|
+
def wait_for_extraction(self, content_ids: Union[str, List[str]]):
|
635
628
|
"""
|
636
629
|
Wait for extraction to complete for a given content id
|
637
630
|
|
638
631
|
Args:
|
639
632
|
- content_id (str): id of content
|
640
633
|
"""
|
641
|
-
|
634
|
+
if type(content_ids) == str:
|
635
|
+
content_ids = [content_ids]
|
636
|
+
print("Waiting for extraction to complete for content id: ", ",".join(content_ids))
|
637
|
+
for content_id in content_ids:
|
638
|
+
response = self.get(f"namespaces/{self.namespace}/content/{content_id}/wait")
|
639
|
+
print("Extraction completed for content id: ", content_id)
|
642
640
|
response.raise_for_status()
|
643
641
|
|
644
642
|
def generate_unique_hex_id(self):
|
@@ -1,5 +1,5 @@
|
|
1
1
|
indexify/__init__.py,sha256=Y40-Ur_tL7kGGs-reh9BTfEYGe-KyGxgdg-CmoFsXRQ,473
|
2
|
-
indexify/client.py,sha256=
|
2
|
+
indexify/client.py,sha256=NwEvU-9FU2U-UkhlKjfVmIUJ9E9DcSIjIJYE4AEqwJA,22109
|
3
3
|
indexify/data_containers.py,sha256=r1wxJPtsmXbyKvb17fqxm-dPjKz51oZ62f8A8Zxls1c,361
|
4
4
|
indexify/error.py,sha256=3umTeYb0ugtUyehV1ibfvaeACxAONPyWPc-1HRN4d1M,856
|
5
5
|
indexify/exceptions.py,sha256=vjd5SPPNFIEW35GorSIodsqvm9RKHQm9kdp8t9gv-WM,111
|
@@ -8,7 +8,7 @@ indexify/extractor.py,sha256=sWFLlXHgEfWlmiKAXN6ytUt_uG7th-XGNHqz-TG39gs,1216
|
|
8
8
|
indexify/index.py,sha256=RvxYhJXEth-GKvqzlMiz5PuN1eIbZk84pt20piA1Gsw,504
|
9
9
|
indexify/settings.py,sha256=LSaWZ0ADIVmUv6o6dHWRC3-Ry5uLbCw2sBSg1e_U7UM,99
|
10
10
|
indexify/utils.py,sha256=rDN2lrsAs9noJEIjfx6ukmC2SAIyrlUt7QU-kaBjujM,125
|
11
|
-
indexify-0.0.
|
12
|
-
indexify-0.0.
|
13
|
-
indexify-0.0.
|
14
|
-
indexify-0.0.
|
11
|
+
indexify-0.0.27.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
12
|
+
indexify-0.0.27.dist-info/METADATA,sha256=Hz-3CZFY5Nz99brOcraBKR8moLhghxgoHOugofABP_c,1798
|
13
|
+
indexify-0.0.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
14
|
+
indexify-0.0.27.dist-info/RECORD,,
|
File without changes
|
File without changes
|