kodexa 7.0.9209424800__py3-none-any.whl → 7.0.9706058442__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.
kodexa/model/model.py CHANGED
@@ -559,9 +559,13 @@ class ContentNode(object):
559
559
  >>> new_page.add_feature('pagination','pageNum',1)
560
560
  """
561
561
  if self.has_feature(feature_type, name):
562
- raise Exception(
563
- f"Feature {feature_type}:{name} already exists on this node, use set_feature to update"
564
- )
562
+ existing_feature = self.get_feature(feature_type, name)
563
+ if isinstance(existing_feature.value, list):
564
+ existing_feature.value.append(value)
565
+ else:
566
+ existing_feature.value = [existing_feature.value, value]
567
+ self.update_feature(existing_feature)
568
+ return existing_feature
565
569
 
566
570
  # Make sure that we treat the value as list all the time
567
571
  new_feature = ContentFeature(
kodexa/model/objects.py CHANGED
@@ -1732,7 +1732,7 @@ class ProjectResourcesUpdate(BaseModel):
1732
1732
  store_refs: Optional[List[str]] = Field(None, alias="storeRefs")
1733
1733
  dashboard_refs: Optional[List[str]] = Field(None, alias="dashboardRefs")
1734
1734
  data_form_refs: Optional[List[str]] = Field(None, alias="dataFormRefs")
1735
- guidance_set_refs: Optional[List[str]] = Field(None, alias="guidanceSetRefs")
1735
+ guidance_set_refs: Optional[List[str]] = Field(None, alias="guidanceRefs")
1736
1736
 
1737
1737
 
1738
1738
  class Role1(Enum):
@@ -5072,6 +5072,13 @@ class ModelContentMetadata(BaseModel):
5072
5072
  alias="additionalTaxonOptions",
5073
5073
  description="This are additional properties that can be set on a label when the model is part of the project",
5074
5074
  )
5075
+
5076
+ taxon_features: Optional[TaxonFeatures] = Field(
5077
+ None,
5078
+ alias="taxonFeatures",
5079
+ description="This are additional properties that can be set as part of the taxon in the taxonomy (not a label but at the taxon level) they will be stored under the type_features",
5080
+ )
5081
+
5075
5082
  contents: Optional[List[str]] = Field(
5076
5083
  None,
5077
5084
  description="A list of the paths (with wildcards) that hold the content of this model",
@@ -5102,6 +5109,33 @@ class Action(ExtensionPackProvided):
5102
5109
  metadata: Optional[ObjectMetadata] = None
5103
5110
 
5104
5111
 
5112
+ class TaxonFeatures(BaseModel):
5113
+ """
5114
+
5115
+ """
5116
+ model_config = ConfigDict(
5117
+ populate_by_name=True,
5118
+ use_enum_values=True,
5119
+ arbitrary_types_allowed=True,
5120
+ protected_namespaces=("model_config",),
5121
+ )
5122
+ """
5123
+ A Custom Event allows you to define an subtype of assistant event with options
5124
+ """
5125
+
5126
+ taxonPath: Optional[str] = Field(
5127
+ None, description="The path of the taxon to add the features to", pattern=r"^[a-zA-Z0-9\-_]{0,40}$"
5128
+ )
5129
+ options: Optional[List[Option]] = Field(
5130
+ None, description="The options to add as type features to the taxon"
5131
+ )
5132
+ group_only: Optional[bool] = Field(
5133
+ None,
5134
+ alias="groupOnly",
5135
+ description="If true, the features will only be added to the group taxon",
5136
+ )
5137
+
5138
+
5105
5139
  class AssistantDefinition(ExtensionPackProvided):
5106
5140
  """
5107
5141
 
@@ -5137,6 +5171,11 @@ class AssistantDefinition(ExtensionPackProvided):
5137
5171
  alias="additionalTaxonOptions",
5138
5172
  description="This are additional properties that can be set on a label when the assistant is part of the project",
5139
5173
  )
5174
+ taxon_features: Optional[TaxonFeatures] = Field(
5175
+ None,
5176
+ alias="taxonFeatures",
5177
+ description="This are additional properties that can be set as part of the taxon in the taxonomy (not a label but at the taxon level) they will be stored under the type_features",
5178
+ )
5140
5179
  event_types: Optional[List[CustomEvent]] = Field(
5141
5180
  None,
5142
5181
  alias="eventTypes",
kodexa/platform/client.py CHANGED
@@ -5432,19 +5432,21 @@ class DocumentStoreEndpoint(StoreEndpoint):
5432
5432
  document_family_response.json()
5433
5433
  ).set_client(self.client)
5434
5434
 
5435
- def stream_query(self, query: str = "*", sort=None):
5435
+ def stream_query(self, query: str = "*", sort=None, limit=None):
5436
5436
  """
5437
5437
  Stream the query for the document family.
5438
5438
 
5439
5439
  Args:
5440
5440
  query (str, optional): The query to run. Defaults to "*".
5441
5441
  sort (str, optional): Sorting order of the query. Defaults to None.
5442
+ limit (int, optional): The maximum number of items to return. Defaults to None.
5442
5443
 
5443
5444
  Returns:
5444
5445
  generator: A generator of the document families.
5445
5446
  """
5446
5447
  page_size = 5
5447
5448
  page = 1
5449
+ number_of_items = 0
5448
5450
 
5449
5451
  if not sort:
5450
5452
  sort = "id"
@@ -5456,7 +5458,12 @@ class DocumentStoreEndpoint(StoreEndpoint):
5456
5458
  if not page_response.content:
5457
5459
  break
5458
5460
  for document_family in page_response.content:
5461
+ number_of_items += 1
5462
+ if limit and number_of_items > limit:
5463
+ break
5464
+
5459
5465
  yield document_family
5466
+
5460
5467
  page += 1
5461
5468
 
5462
5469
  def query(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.0.9209424800
3
+ Version: 7.0.9706058442
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -8,13 +8,13 @@ kodexa/model/base.py,sha256=CaZK8nMhT1LdCpt4aLhebJGcorjq9qRID1FjnXnP14M,521
8
8
  kodexa/model/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  kodexa/model/entities/product.py,sha256=ZDpHuBE_9FJ-klnkyBvTfPwYOqBkM1wraZMtHqNA8FQ,3526
10
10
  kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
11
- kodexa/model/model.py,sha256=xAUPiW_1V9Kn9yitrvKFVuG_ms_N4HlAx23dwGln8Ro,115561
12
- kodexa/model/objects.py,sha256=xL6G5lk76fO13QEcELX15HuKE3PKkBgS2Saxl3Ns0aE,174417
11
+ kodexa/model/model.py,sha256=BURhrOEVTTlKkDJho5CEFeLR9Dyq157mztlvbAdL1d4,115769
12
+ kodexa/model/objects.py,sha256=RNp7uqTyCPlTLKnoikHQBAG6ujPbfuwgFR2S49djj9I,175785
13
13
  kodexa/model/persistence.py,sha256=sx5FwTSsWMdAZpAs0-6PqyULHkQyNQClApUKJZ-ly8M,62032
14
14
  kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
15
15
  kodexa/pipeline/pipeline.py,sha256=ZYpJAWcwV4YRK589DUhU0vXGQlkNSj4J2TsGbYqTLjo,25221
16
16
  kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
17
- kodexa/platform/client.py,sha256=73aTTeGiYw7vUTuGKoR8vZQ68KiE2IYIEUozSN7_cxU,220924
17
+ kodexa/platform/client.py,sha256=IOkBDespqZkWNNbK2WSnrHsr5sPZ7JI4PojaikTvc4o,221175
18
18
  kodexa/platform/interaction.py,sha256=6zpcwXKNZstUGNS6m4JsoRXAqCZPJHWI-ZN3co8nnF0,1055
19
19
  kodexa/platform/kodexa.py,sha256=Bvf6x43FWsFuAuQ4N8TvjSZq6niEtBTESmFCWVPASeQ,34024
20
20
  kodexa/selectors/__init__.py,sha256=xA9-4vpyaAZWPSk3bh2kvDLkdv6XEmm7PjFbpziiTIk,100
@@ -38,7 +38,7 @@ kodexa/testing/test_components.py,sha256=g5lP-GY0nTHuH5cIEw45vIejEeBaWkPKQGHL36j
38
38
  kodexa/testing/test_utils.py,sha256=DrLCkHxdb6AbZ-X3WmTMbQmnVIm55VEBL8MjtUK9POs,14021
39
39
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
40
40
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- kodexa-7.0.9209424800.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
42
- kodexa-7.0.9209424800.dist-info/METADATA,sha256=sxku-trJABwDiWwlhhgeydKy0b4NBNT5BJlBTq7Ui-0,3486
43
- kodexa-7.0.9209424800.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
44
- kodexa-7.0.9209424800.dist-info/RECORD,,
41
+ kodexa-7.0.9706058442.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
42
+ kodexa-7.0.9706058442.dist-info/METADATA,sha256=ipVBsrAo4A5JbbcOMPRXUk3mW7_3BsuaQhk8ucGT2xc,3486
43
+ kodexa-7.0.9706058442.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
44
+ kodexa-7.0.9706058442.dist-info/RECORD,,