kodexa 7.4.412538129491__tar.gz → 7.4.412795054059__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/PKG-INFO +1 -1
  2. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/platform/client.py +27 -7
  3. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/pyproject.toml +1 -1
  4. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/LICENSE +0 -0
  5. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/README.md +0 -0
  6. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/__init__.py +0 -0
  7. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/assistant/__init__.py +0 -0
  8. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/assistant/assistant.py +0 -0
  9. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/connectors/__init__.py +0 -0
  10. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/connectors/connectors.py +0 -0
  11. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/dataclasses/__init__.py +0 -0
  12. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
  13. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/__init__.py +0 -0
  14. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/base.py +0 -0
  15. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/entities/__init__.py +0 -0
  16. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/entities/check_response.py +0 -0
  17. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/entities/product.py +0 -0
  18. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/entities/product_group.py +0 -0
  19. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/entities/product_subscription.py +0 -0
  20. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/model.py +0 -0
  21. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/objects.py +0 -0
  22. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/persistence.py +0 -0
  23. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/model/utils.py +0 -0
  24. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/pipeline/__init__.py +0 -0
  25. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/pipeline/pipeline.py +0 -0
  26. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/platform/__init__.py +0 -0
  27. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/platform/interaction.py +0 -0
  28. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/platform/kodexa.py +0 -0
  29. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/__init__.py +0 -0
  30. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/ast.py +0 -0
  31. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/core.py +0 -0
  32. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/lexrules.py +0 -0
  33. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/lextab.py +0 -0
  34. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/lextab.pyi +0 -0
  35. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/parserules.py +0 -0
  36. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/parserules.pyi +0 -0
  37. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/parsetab.py +0 -0
  38. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/selectors/parsetab.pyi +0 -0
  39. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/spatial/__init__.py +0 -0
  40. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/spatial/azure_models.py +0 -0
  41. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/spatial/bbox_common.py +0 -0
  42. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/spatial/table_form_common.py +0 -0
  43. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/steps/__init__.py +0 -0
  44. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/steps/common.py +0 -0
  45. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/testing/__init__.py +0 -0
  46. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/testing/test_components.py +0 -0
  47. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/testing/test_utils.py +0 -0
  48. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/training/__init__.py +0 -0
  49. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/training/train_utils.py +0 -0
  50. {kodexa-7.4.412538129491 → kodexa-7.4.412795054059}/kodexa/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.4.412538129491
3
+ Version: 7.4.412795054059
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -4783,7 +4783,8 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
4783
4783
  self.client.put(url, body=document_status.model_dump(by_alias=True))
4784
4784
 
4785
4785
  def add_document(
4786
- self, document: Document, content_object: Optional[ContentObject] = None
4786
+ self, document: Document, content_object: Optional[ContentObject] = None,
4787
+ taxonomies: Optional[List[Taxonomy]] = None, data_store: Optional[Store] = None
4787
4788
  ):
4788
4789
  """
4789
4790
  Add a document to the document family.
@@ -4791,22 +4792,36 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
4791
4792
  Args:
4792
4793
  document (Document): The document to add.
4793
4794
  content_object (Optional[ContentObject]): The content object. Defaults to None.
4795
+ taxonomies (Optional[List[Taxonomy]]): List of taxonomies to use. Defaults to None.
4796
+ data_store (Optional[Store]): Data store to add document to. Defaults to None.
4794
4797
  """
4795
4798
  url = (
4796
4799
  f'/api/stores/{self.store_ref.replace(":", "/")}/families/{self.id}/objects'
4797
4800
  )
4798
4801
  if content_object is None:
4799
4802
  content_object = self.content_objects[-1]
4803
+
4804
+ params = {
4805
+ "sourceContentObjectId": content_object.id,
4806
+ "transitionType": "DERIVED",
4807
+ "documentVersion": document.version
4808
+ }
4809
+
4810
+ # If we have a store but no taxonomies or the other way around then we need to throw an error
4811
+ if (data_store and not taxonomies) or (taxonomies and not data_store):
4812
+ raise Exception("If you provide a data store you must also provide taxonomies and vice-versa")
4813
+
4814
+ if taxonomies:
4815
+ params["taxonomyRefs"] = ",".join([taxonomy.ref for taxonomy in taxonomies])
4816
+
4817
+ if data_store:
4818
+ params["dataStoreRef"] = data_store.ref
4819
+
4800
4820
  self.client.post(
4801
4821
  url,
4802
- params={
4803
- "sourceContentObjectId": content_object.id,
4804
- "transitionType": "DERIVED",
4805
- "documentVersion": document.version,
4806
- },
4822
+ params=params,
4807
4823
  files={"file": document.to_kddb()},
4808
4824
  )
4809
-
4810
4825
  def export_as_zip(self) -> bytes:
4811
4826
  """
4812
4827
  Export the document family as bytes.
@@ -5093,6 +5108,7 @@ class DataStoreEndpoint(StoreEndpoint):
5093
5108
  path: Optional[str] = None,
5094
5109
  root_name: str = "",
5095
5110
  friendly_names=True,
5111
+ project_id: Optional[str] = None,
5096
5112
  ) -> str:
5097
5113
  """Get the data objects export of the store
5098
5114
 
@@ -5102,6 +5118,7 @@ class DataStoreEndpoint(StoreEndpoint):
5102
5118
  path (Optional[str]): The path to the data object
5103
5119
  root_name (str): The root name of the data objects export
5104
5120
  friendly_names (bool): Whether to use friendly names. Defaults to True
5121
+ project_id (Optional[str]): The project ID
5105
5122
 
5106
5123
  Returns:
5107
5124
  str: The data objects export of the store
@@ -5117,6 +5134,9 @@ class DataStoreEndpoint(StoreEndpoint):
5117
5134
 
5118
5135
  if path:
5119
5136
  params["path"] = path
5137
+
5138
+ if project_id:
5139
+ params["projectId"] = project_id
5120
5140
 
5121
5141
  if output_format == "csv" and not path:
5122
5142
  raise ValueError("CSV output requires a path")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kodexa"
3
- version = "7.4.412538129491"
3
+ version = "7.4.412795054059"
4
4
  description = "Python SDK for the Kodexa Platform"
5
5
  authors = ["Austin Redenbaugh <austin@kodexa.com>", "Philip Dodds <philip@kodexa.com>", "Romar Cablao <rcablao@kodexa.com>", "Amadea Paula Dodds <amadeapaula@kodexa.com>"]
6
6
  readme = "README.md"