kodexa 7.0.1a9196705380__py3-none-any.whl → 7.0.1a9956673208__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 +7 -3
- kodexa/model/objects.py +52 -0
- kodexa/platform/client.py +131 -7
- {kodexa-7.0.1a9196705380.dist-info → kodexa-7.0.1a9956673208.dist-info}/METADATA +1 -1
- {kodexa-7.0.1a9196705380.dist-info → kodexa-7.0.1a9956673208.dist-info}/RECORD +7 -7
- {kodexa-7.0.1a9196705380.dist-info → kodexa-7.0.1a9956673208.dist-info}/LICENSE +0 -0
- {kodexa-7.0.1a9196705380.dist-info → kodexa-7.0.1a9956673208.dist-info}/WHEEL +0 -0
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
|
-
|
563
|
-
|
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,6 +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="guidanceRefs")
|
1735
1736
|
|
1736
1737
|
|
1737
1738
|
class Role1(Enum):
|
@@ -3850,6 +3851,18 @@ class DocumentEmbedding(BaseModel):
|
|
3850
3851
|
node_uuid: Optional[str] = Field(None, alias="nodeUuid")
|
3851
3852
|
|
3852
3853
|
|
3854
|
+
class DocumentExternalData(BaseModel):
|
3855
|
+
model_config = ConfigDict(
|
3856
|
+
populate_by_name=True,
|
3857
|
+
use_enum_values=True,
|
3858
|
+
arbitrary_types_allowed=True,
|
3859
|
+
protected_namespaces=("model_config",),
|
3860
|
+
)
|
3861
|
+
|
3862
|
+
external_data: Optional[Dict[str, Any]] = Field(None, alias="externalData")
|
3863
|
+
document_family: Optional[DocumentFamily] = Field(None, alias="documentFamily")
|
3864
|
+
|
3865
|
+
|
3853
3866
|
class DocumentFamily(BaseModel):
|
3854
3867
|
"""
|
3855
3868
|
|
@@ -5071,6 +5084,13 @@ class ModelContentMetadata(BaseModel):
|
|
5071
5084
|
alias="additionalTaxonOptions",
|
5072
5085
|
description="This are additional properties that can be set on a label when the model is part of the project",
|
5073
5086
|
)
|
5087
|
+
|
5088
|
+
taxon_features: Optional[List[TaxonFeatures]] = Field(
|
5089
|
+
None,
|
5090
|
+
alias="taxonFeatures",
|
5091
|
+
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",
|
5092
|
+
)
|
5093
|
+
|
5074
5094
|
contents: Optional[List[str]] = Field(
|
5075
5095
|
None,
|
5076
5096
|
description="A list of the paths (with wildcards) that hold the content of this model",
|
@@ -5101,6 +5121,33 @@ class Action(ExtensionPackProvided):
|
|
5101
5121
|
metadata: Optional[ObjectMetadata] = None
|
5102
5122
|
|
5103
5123
|
|
5124
|
+
class TaxonFeatures(BaseModel):
|
5125
|
+
"""
|
5126
|
+
|
5127
|
+
"""
|
5128
|
+
model_config = ConfigDict(
|
5129
|
+
populate_by_name=True,
|
5130
|
+
use_enum_values=True,
|
5131
|
+
arbitrary_types_allowed=True,
|
5132
|
+
protected_namespaces=("model_config",),
|
5133
|
+
)
|
5134
|
+
"""
|
5135
|
+
A Custom Event allows you to define an subtype of assistant event with options
|
5136
|
+
"""
|
5137
|
+
|
5138
|
+
taxonPath: Optional[str] = Field(
|
5139
|
+
None, description="The path of the taxon to add the features to", pattern=r"^[a-zA-Z0-9\-_]{0,40}$"
|
5140
|
+
)
|
5141
|
+
options: Optional[List[Option]] = Field(
|
5142
|
+
None, description="The options to add as type features to the taxon"
|
5143
|
+
)
|
5144
|
+
group_only: Optional[bool] = Field(
|
5145
|
+
None,
|
5146
|
+
alias="groupOnly",
|
5147
|
+
description="If true, the features will only be added to the group taxon",
|
5148
|
+
)
|
5149
|
+
|
5150
|
+
|
5104
5151
|
class AssistantDefinition(ExtensionPackProvided):
|
5105
5152
|
"""
|
5106
5153
|
|
@@ -5136,6 +5183,11 @@ class AssistantDefinition(ExtensionPackProvided):
|
|
5136
5183
|
alias="additionalTaxonOptions",
|
5137
5184
|
description="This are additional properties that can be set on a label when the assistant is part of the project",
|
5138
5185
|
)
|
5186
|
+
taxon_features: Optional[List[TaxonFeatures]] = Field(
|
5187
|
+
None,
|
5188
|
+
alias="taxonFeatures",
|
5189
|
+
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",
|
5190
|
+
)
|
5139
5191
|
event_types: Optional[List[CustomEvent]] = Field(
|
5140
5192
|
None,
|
5141
5193
|
alias="eventTypes",
|
kodexa/platform/client.py
CHANGED
@@ -86,6 +86,7 @@ from kodexa.model.objects import (
|
|
86
86
|
PageExtensionPack,
|
87
87
|
PageOrganization,
|
88
88
|
DocumentFamilyStatistics, MessageContext, PagePrompt, Prompt, GuidanceSet, PageGuidanceSet, DocumentEmbedding,
|
89
|
+
DocumentExternalData,
|
89
90
|
)
|
90
91
|
|
91
92
|
logger = logging.getLogger()
|
@@ -1550,6 +1551,20 @@ class OrganizationEndpoint(Organization, EntityEndpoint):
|
|
1550
1551
|
.set_client(self.client)
|
1551
1552
|
)
|
1552
1553
|
|
1554
|
+
@property
|
1555
|
+
def guidance_sets(self) -> "GuidanceSetsEndpoint":
|
1556
|
+
"""
|
1557
|
+
Get the guidance sets endpoint of the organization.
|
1558
|
+
|
1559
|
+
Returns:
|
1560
|
+
GuidanceSetsEndpoint: The guidance sets endpoint of the organization.
|
1561
|
+
"""
|
1562
|
+
return (
|
1563
|
+
GuidanceSetsEndpoint()
|
1564
|
+
.set_organization(self)
|
1565
|
+
.set_client(self.client)
|
1566
|
+
)
|
1567
|
+
|
1553
1568
|
@property
|
1554
1569
|
def credentials(self):
|
1555
1570
|
"""
|
@@ -2067,6 +2082,38 @@ class ProjectDocumentStoresEndpoint(ProjectResourceEndpoint):
|
|
2067
2082
|
return DocumentStoreEndpoint
|
2068
2083
|
|
2069
2084
|
|
2085
|
+
class ProjectDashboardsEndpoint(ProjectResourceEndpoint):
|
2086
|
+
"""Represents a project dashboards endpoint.
|
2087
|
+
|
2088
|
+
This class is used to represent a project document stores endpoint in the system.
|
2089
|
+
"""
|
2090
|
+
|
2091
|
+
"""Represents a project document stores endpoint"""
|
2092
|
+
|
2093
|
+
def get_type(self) -> str:
|
2094
|
+
"""Get the type of the endpoint.
|
2095
|
+
|
2096
|
+
This method is used to get the type of the endpoint.
|
2097
|
+
|
2098
|
+
Returns:
|
2099
|
+
str: The type of the endpoint.
|
2100
|
+
"""
|
2101
|
+
return "dashboards"
|
2102
|
+
|
2103
|
+
def get_instance_class(self, object_dict=None):
|
2104
|
+
"""Get the instance class of the project document stores endpoint.
|
2105
|
+
|
2106
|
+
This method is used to get the instance class of the project document stores endpoint.
|
2107
|
+
|
2108
|
+
Args:
|
2109
|
+
object_dict (dict, optional): The object dictionary. Defaults to None.
|
2110
|
+
|
2111
|
+
Returns:
|
2112
|
+
DocumentStoreEndpoint: The instance class of the project document stores endpoint.
|
2113
|
+
"""
|
2114
|
+
return DashboardEndpoint
|
2115
|
+
|
2116
|
+
|
2070
2117
|
class GuidanceSetEndpoint(ComponentInstanceEndpoint, GuidanceSet):
|
2071
2118
|
|
2072
2119
|
def get_type(self) -> str:
|
@@ -2119,6 +2166,38 @@ class PagePromptEndpoint(PagePrompt, PageEndpoint):
|
|
2119
2166
|
pass
|
2120
2167
|
|
2121
2168
|
|
2169
|
+
class ProjectDataFormsEndpoint(ProjectResourceEndpoint):
|
2170
|
+
"""Represents a project data forms endpoint.
|
2171
|
+
|
2172
|
+
This class is used to represent a project taxonomies endpoint in the system.
|
2173
|
+
"""
|
2174
|
+
|
2175
|
+
"""Represents a project taxonomies endpoint"""
|
2176
|
+
|
2177
|
+
def get_type(self) -> str:
|
2178
|
+
"""Get the type of the endpoint.
|
2179
|
+
|
2180
|
+
This method is used to get the type of the endpoint.
|
2181
|
+
|
2182
|
+
Returns:
|
2183
|
+
str: The type of the endpoint.
|
2184
|
+
"""
|
2185
|
+
return "dataForms"
|
2186
|
+
|
2187
|
+
def get_instance_class(self, object_dict=None):
|
2188
|
+
"""Get the instance class of the project data form endpoint.
|
2189
|
+
|
2190
|
+
This method is used to get the instance class of the project dataform endpoint.
|
2191
|
+
|
2192
|
+
Args:
|
2193
|
+
object_dict (dict, optional): The object dictionary. Defaults to None.
|
2194
|
+
|
2195
|
+
Returns:
|
2196
|
+
TaxonomyEndpoint: The instance class of the project taxonomies endpoint.
|
2197
|
+
"""
|
2198
|
+
return DataFormEndpoint
|
2199
|
+
|
2200
|
+
|
2122
2201
|
class ProjectTaxonomiesEndpoint(ProjectResourceEndpoint):
|
2123
2202
|
"""Represents a project taxonomies endpoint.
|
2124
2203
|
|
@@ -2157,7 +2236,7 @@ class ProjectGuidanceSetsEndpoint(ProjectResourceEndpoint):
|
|
2157
2236
|
return "guidance"
|
2158
2237
|
|
2159
2238
|
def get_instance_class(self, object_dict=None):
|
2160
|
-
return
|
2239
|
+
return GuidanceSetEndpoint
|
2161
2240
|
|
2162
2241
|
|
2163
2242
|
class ProjectDataFormEndpoint(ProjectResourceEndpoint):
|
@@ -2459,7 +2538,7 @@ class ProjectEndpoint(EntityEndpoint, Project):
|
|
2459
2538
|
stores: List["StoreEndpoint"] = None,
|
2460
2539
|
taxonomies: List["TaxonomyEndpoint"] = None,
|
2461
2540
|
data_forms: List["DataFormEndpoint"] = None,
|
2462
|
-
guidance: List["
|
2541
|
+
guidance: List["GuidanceSetEndpoint"] = None,
|
2463
2542
|
dashboards: List["DashboardEndpoint"] = None,
|
2464
2543
|
):
|
2465
2544
|
"""Update the resources of the project.
|
@@ -2503,6 +2582,15 @@ class ProjectEndpoint(EntityEndpoint, Project):
|
|
2503
2582
|
body=json.loads(project_resources_update.json(by_alias=True)),
|
2504
2583
|
)
|
2505
2584
|
|
2585
|
+
@property
|
2586
|
+
def dashboards(self) -> ProjectDashboardsEndpoint:
|
2587
|
+
"""Get the document stores endpoint of the project.
|
2588
|
+
|
2589
|
+
Returns:
|
2590
|
+
ProjectDocumentStoresEndpoint: The document stores endpoint of the project.
|
2591
|
+
"""
|
2592
|
+
return ProjectDashboardsEndpoint().set_client(self.client).set_project(self)
|
2593
|
+
|
2506
2594
|
@property
|
2507
2595
|
def document_stores(self) -> ProjectDocumentStoresEndpoint:
|
2508
2596
|
"""Get the document stores endpoint of the project.
|
@@ -2540,13 +2628,22 @@ class ProjectEndpoint(EntityEndpoint, Project):
|
|
2540
2628
|
return ProjectTaxonomiesEndpoint().set_client(self.client).set_project(self)
|
2541
2629
|
|
2542
2630
|
@property
|
2543
|
-
def guidance(self) -> "
|
2631
|
+
def guidance(self) -> "ProjectGuidanceSetsEndpoint":
|
2544
2632
|
"""Get the guidance sets endpoint of the project.
|
2545
2633
|
|
2546
2634
|
Returns:
|
2547
2635
|
GuidanceSetsEndpoint: The guidance sets endpoint of the project.
|
2548
2636
|
"""
|
2549
|
-
return
|
2637
|
+
return ProjectGuidanceSetsEndpoint().set_client(self.client).set_project(self)
|
2638
|
+
|
2639
|
+
@property
|
2640
|
+
def data_forms(self) -> "ProjectDataFormsEndpoint":
|
2641
|
+
"""Get the guidance sets endpoint of the project.
|
2642
|
+
|
2643
|
+
Returns:
|
2644
|
+
GuidanceSetsEndpoint: The guidance sets endpoint of the project.
|
2645
|
+
"""
|
2646
|
+
return ProjectDataFormsEndpoint().set_client(self.client).set_project(self)
|
2550
2647
|
|
2551
2648
|
@property
|
2552
2649
|
def assistants(self) -> ProjectAssistantsEndpoint:
|
@@ -2582,7 +2679,6 @@ class ProjectEndpoint(EntityEndpoint, Project):
|
|
2582
2679
|
return [ProjectTag.model_validate(tag) for tag in response.json()]
|
2583
2680
|
|
2584
2681
|
|
2585
|
-
|
2586
2682
|
class MessagesEndpoint(EntitiesEndpoint):
|
2587
2683
|
"""Represents a message endpoint"""
|
2588
2684
|
|
@@ -4361,6 +4457,28 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4361
4457
|
response = self.client.get(url)
|
4362
4458
|
process_response(response)
|
4363
4459
|
|
4460
|
+
def get_external_data(self) -> DocumentExternalData:
|
4461
|
+
"""
|
4462
|
+
Get the external data of the document family.
|
4463
|
+
|
4464
|
+
Returns:
|
4465
|
+
DocumentExternalData: The external data of the document family.
|
4466
|
+
"""
|
4467
|
+
url = f"/api/documentFamilies/{self.id}/externalData"
|
4468
|
+
response = self.client.get(url)
|
4469
|
+
return DocumentExternalData.model_validate(response.json())
|
4470
|
+
|
4471
|
+
def update_external_data(self, external_data: DocumentExternalData):
|
4472
|
+
"""
|
4473
|
+
Update the external data of the document family.
|
4474
|
+
|
4475
|
+
Args:
|
4476
|
+
external_data (DocumentExternalData): The external data to update.
|
4477
|
+
"""
|
4478
|
+
url = f"/api/documentFamilies/{self.id}/externalData"
|
4479
|
+
response = self.client.put(url, body=external_data.model_dump(mode="json", by_alias=True))
|
4480
|
+
process_response(response)
|
4481
|
+
|
4364
4482
|
def export(self) -> bytes:
|
4365
4483
|
"""
|
4366
4484
|
Export the document family as bytes.
|
@@ -5337,19 +5455,21 @@ class DocumentStoreEndpoint(StoreEndpoint):
|
|
5337
5455
|
document_family_response.json()
|
5338
5456
|
).set_client(self.client)
|
5339
5457
|
|
5340
|
-
def stream_query(self, query: str = "*", sort=None):
|
5458
|
+
def stream_query(self, query: str = "*", sort=None, limit=None):
|
5341
5459
|
"""
|
5342
5460
|
Stream the query for the document family.
|
5343
5461
|
|
5344
5462
|
Args:
|
5345
5463
|
query (str, optional): The query to run. Defaults to "*".
|
5346
5464
|
sort (str, optional): Sorting order of the query. Defaults to None.
|
5465
|
+
limit (int, optional): The maximum number of items to return. Defaults to None.
|
5347
5466
|
|
5348
5467
|
Returns:
|
5349
5468
|
generator: A generator of the document families.
|
5350
5469
|
"""
|
5351
5470
|
page_size = 5
|
5352
5471
|
page = 1
|
5472
|
+
number_of_items = 0
|
5353
5473
|
|
5354
5474
|
if not sort:
|
5355
5475
|
sort = "id"
|
@@ -5361,7 +5481,12 @@ class DocumentStoreEndpoint(StoreEndpoint):
|
|
5361
5481
|
if not page_response.content:
|
5362
5482
|
break
|
5363
5483
|
for document_family in page_response.content:
|
5484
|
+
number_of_items += 1
|
5485
|
+
if limit and number_of_items > limit:
|
5486
|
+
break
|
5487
|
+
|
5364
5488
|
yield document_family
|
5489
|
+
|
5365
5490
|
page += 1
|
5366
5491
|
|
5367
5492
|
def query(
|
@@ -6229,7 +6354,6 @@ class KodexaClient:
|
|
6229
6354
|
self.messages = MessagesEndpoint(self)
|
6230
6355
|
from kodexa.model.entities.product import ProductsEndpoint
|
6231
6356
|
self.products = ProductsEndpoint(self)
|
6232
|
-
self.guidance_sets = GuidanceSetsEndpoint(self)
|
6233
6357
|
|
6234
6358
|
@staticmethod
|
6235
6359
|
def login(url, token):
|
@@ -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=
|
12
|
-
kodexa/model/objects.py,sha256=
|
11
|
+
kodexa/model/model.py,sha256=BURhrOEVTTlKkDJho5CEFeLR9Dyq157mztlvbAdL1d4,115769
|
12
|
+
kodexa/model/objects.py,sha256=1do5qAkQu-zVnkRpfWkDaEJk-qlgTL_mLhYIlXjg-ec,176187
|
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=
|
17
|
+
kodexa/platform/client.py,sha256=ZctQyY_iHmEO7ukPeiyBAD-Ad1mMQhSXJr7-d5JNLzQ,222044
|
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.
|
42
|
-
kodexa-7.0.
|
43
|
-
kodexa-7.0.
|
44
|
-
kodexa-7.0.
|
41
|
+
kodexa-7.0.1a9956673208.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
42
|
+
kodexa-7.0.1a9956673208.dist-info/METADATA,sha256=1x2bdZDsWhNZsqn-zRqB-I2yGLfneBGvhTExMNRVttY,3488
|
43
|
+
kodexa-7.0.1a9956673208.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
44
|
+
kodexa-7.0.1a9956673208.dist-info/RECORD,,
|
File without changes
|
File without changes
|