indexify 0.0.26__py3-none-any.whl → 0.0.28__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 +9 -3
- indexify/extraction_policy.py +7 -0
- {indexify-0.0.26.dist-info → indexify-0.0.28.dist-info}/METADATA +1 -1
- {indexify-0.0.26.dist-info → indexify-0.0.28.dist-info}/RECORD +6 -6
- {indexify-0.0.26.dist-info → indexify-0.0.28.dist-info}/LICENSE.txt +0 -0
- {indexify-0.0.26.dist-info → indexify-0.0.28.dist-info}/WHEEL +0 -0
indexify/client.py
CHANGED
@@ -622,16 +622,22 @@ class IndexifyClient:
|
|
622
622
|
json=req,
|
623
623
|
headers={"Content-Type": "application/json"},
|
624
624
|
)
|
625
|
-
|
625
|
+
response.raise_for_status()
|
626
|
+
return response.json()["content_id"]
|
626
627
|
|
627
|
-
def wait_for_extraction(self,
|
628
|
+
def wait_for_extraction(self, content_ids: Union[str, List[str]]):
|
628
629
|
"""
|
629
630
|
Wait for extraction to complete for a given content id
|
630
631
|
|
631
632
|
Args:
|
632
633
|
- content_id (str): id of content
|
633
634
|
"""
|
634
|
-
|
635
|
+
if type(content_ids) == str:
|
636
|
+
content_ids = [content_ids]
|
637
|
+
print("Waiting for extraction to complete for content id: ", ",".join(content_ids))
|
638
|
+
for content_id in content_ids:
|
639
|
+
response = self.get(f"namespaces/{self.namespace}/content/{content_id}/wait")
|
640
|
+
print("Extraction completed for content id: ", content_id)
|
635
641
|
response.raise_for_status()
|
636
642
|
|
637
643
|
def generate_unique_hex_id(self):
|
indexify/extraction_policy.py
CHANGED
@@ -33,11 +33,13 @@ class ExtractionPolicy:
|
|
33
33
|
class ExtractionGraph:
|
34
34
|
id: str
|
35
35
|
name: str
|
36
|
+
description: str
|
36
37
|
extraction_policies: List[ExtractionPolicy]
|
37
38
|
|
38
39
|
@classmethod
|
39
40
|
def from_dict(cls, json: dict):
|
40
41
|
json["id"] = json.get("id", None)
|
42
|
+
json["description"] = json.get("description", None)
|
41
43
|
if "namespace" in json.keys():
|
42
44
|
json.pop("namespace")
|
43
45
|
return ExtractionGraph(**json)
|
@@ -47,6 +49,11 @@ class ExtractionGraph:
|
|
47
49
|
import yaml
|
48
50
|
|
49
51
|
return ExtractionGraph.from_dict(yaml.load(spec, Loader=yaml.FullLoader))
|
52
|
+
|
53
|
+
@staticmethod
|
54
|
+
def from_yaml_file(path: str):
|
55
|
+
with open(path, "r") as f:
|
56
|
+
return ExtractionGraph.from_yaml(f.read())
|
50
57
|
|
51
58
|
def to_dict(self) -> dict:
|
52
59
|
filtered_dict = {k: v for k, v in asdict(self).items() if v is not None}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
indexify/__init__.py,sha256=Y40-Ur_tL7kGGs-reh9BTfEYGe-KyGxgdg-CmoFsXRQ,473
|
2
|
-
indexify/client.py,sha256=
|
2
|
+
indexify/client.py,sha256=qECQvvVPvzMDra8OQ-94u7J5ABFWSEmEx_uIEdJ3RiU,22159
|
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
|
6
|
-
indexify/extraction_policy.py,sha256=
|
6
|
+
indexify/extraction_policy.py,sha256=POluredrBw6DzTN0OyfPLaLFP5-2DoWGRK0V6w68R28,2080
|
7
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.28.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
12
|
+
indexify-0.0.28.dist-info/METADATA,sha256=3r9wATECrfXFfmI68yU2cUOtrOBR4nT_ajPnag8IdZg,1798
|
13
|
+
indexify-0.0.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
14
|
+
indexify-0.0.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|