indexify 0.0.24__tar.gz → 0.0.26__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.0.24
3
+ Version: 0.0.26
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -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 = DEFAULT_SERVICE_URL,
111
+ service_url: str = DEFAULT_SERVICE_URL_HTTPS,
112
112
  *args,
113
113
  **kwargs,
114
114
  ) -> "IndexifyClient":
@@ -535,7 +535,7 @@ class IndexifyClient:
535
535
  response = self.post(
536
536
  f"namespaces/{self.namespace}/upload_file",
537
537
  files={"file": f},
538
- data=labels,
538
+ data={"labels": json.dumps(labels)},
539
539
  params=params,
540
540
  )
541
541
  response_json = response.json()
@@ -560,7 +560,7 @@ class IndexifyClient:
560
560
  )
561
561
  return response.json()
562
562
 
563
- def get_extracted_content(self, content_id: str, level: int = 0):
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
- def traverse_content(parent_id, current_level):
575
- if current_level > level:
576
- return
577
-
578
- for item in content_tree["content_tree_metadata"]:
579
- if item["parent_id"] == parent_id:
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
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "indexify"
3
- version = "0.0.24"
3
+ version = "0.0.26"
4
4
  description = "Python Client for Indexify"
5
5
  authors = ["Diptanu Gon Choudhury <diptanuc@gmail.com>", "Lucas Jackson <lucas@tensorlake.ai>", "Vijay Parthasarathy <vijay2win@gmail.com>"]
6
6
  license = "Apache 2.0"
File without changes
File without changes
File without changes
File without changes
File without changes