kodexa 7.4.413710499207__py3-none-any.whl → 7.4.413771246579__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/utils.py CHANGED
@@ -23,6 +23,9 @@ def get_pretty_text_from_lines(lines: list[ContentNode], scale, include_line_uui
23
23
 
24
24
  def get_max_width(lines: list[ContentNode], max_width=None) -> int:
25
25
  if max_width is None:
26
+ if lines is None or len(lines) == 0:
27
+ return 250
28
+
26
29
  # Find the line with the most words
27
30
  max_words_line = max(lines, key=lambda line: sum(len(word.get_all_content()) for word in line.select('//word')))
28
31
 
kodexa/platform/client.py CHANGED
@@ -908,6 +908,21 @@ class OrganizationsEndpoint(EntitiesEndpoint):
908
908
  if organizations.number_of_elements == 0:
909
909
  return None
910
910
  return organizations.content[0]
911
+
912
+ def find_by_name(self, name) -> Optional["OrganizationEndpoint"]:
913
+ """
914
+ Find an organization by name.
915
+
916
+ Args:
917
+ name (str): The name of the organization.
918
+
919
+ Returns:
920
+ Optional[OrganizationEndpoint]: The organization if found, None otherwise.
921
+ """
922
+ organizations = self.list(filters=["name: '" + name + "'"])
923
+ if organizations.number_of_elements == 0:
924
+ return None
925
+ return organizations.content[0]
911
926
 
912
927
 
913
928
  class PageEndpoint(ClientEndpoint):
@@ -1347,6 +1362,21 @@ class TaskDocumentFamiliesEndpoint(EntitiesEndpoint):
1347
1362
  return PageTaskDocumentFamilyEndpoint
1348
1363
 
1349
1364
 
1365
+ class DocumentFamiliesEndpoint(EntitiesEndpoint):
1366
+ """
1367
+ Represents document families endpoints.
1368
+ """
1369
+
1370
+ def get_type(self) -> str:
1371
+ return "documentFamilies"
1372
+
1373
+ def get_instance_class(self, object_dict=None):
1374
+ return DocumentFamilyEndpoint
1375
+
1376
+ def get_page_class(self, object_dict=None):
1377
+ return PageDocumentFamilyEndpoint
1378
+
1379
+
1350
1380
  class TaskTagEndpoint(EntityEndpoint, TaskTag):
1351
1381
  """
1352
1382
  Represents a task tag endpoint.
@@ -6487,6 +6517,13 @@ OBJECT_TYPES = {
6487
6517
  "type": TaskDocumentFamilyEndpoint,
6488
6518
  "global": True,
6489
6519
  "endpoint": TaskDocumentFamiliesEndpoint,
6520
+ },
6521
+ "documentFamilies": {
6522
+ "name": "documentFamily",
6523
+ "plural": "documentFamilies",
6524
+ "type": DocumentFamilyEndpoint,
6525
+ "global": True,
6526
+ "endpoint": DocumentFamiliesEndpoint,
6490
6527
  }
6491
6528
  }
6492
6529
 
@@ -6626,22 +6663,27 @@ class KodexaClient:
6626
6663
  Attributes:
6627
6664
  base_url (str): The base URL for the Kodexa platform.
6628
6665
  access_token (str): The access token for the Kodexa platform.
6629
- organizations (OrganizationsEndpoint): An endpoint for organizations.
6630
- projects (ProjectsEndpoint): An endpoint for projects.
6631
- workspaces (WorkspacesEndpoint): An endpoint for workspaces.
6632
- users (UsersEndpoint): An endpoint for users.
6633
- memberships (MembershipsEndpoint): An endpoint for memberships.
6634
- executions (ExecutionsEndpoint): An endpoint for executions.
6666
+
6667
+ assistants (AssistantsEndpoint): An endpoint for assistants.
6635
6668
  channels (ChannelsEndpoint): An endpoint for channels.
6669
+ executions (ExecutionsEndpoint): An endpoint for executions.
6670
+ memberships (MembershipsEndpoint): An endpoint for memberships.
6636
6671
  messages (MessagesEndpoint): An endpoint for messages.
6637
- assistants (AssistantsEndpoint): An endpoint for assistants.
6672
+ organizations (OrganizationsEndpoint): An endpoint for organizations.
6638
6673
  products (ProductsEndpoint): An endpoint for products.
6639
- tasks (TasksEndpoint): An endpoint for tasks.
6674
+ projects (ProjectsEndpoint): An endpoint for projects.
6640
6675
  retained_guidances (RetainedGuidancesEndpoint): An endpoint for retained guidances.
6676
+ task_activities (TaskActivitiesEndpoint): An endpoint for task activities.
6677
+ task_document_families (TaskDocumentFamiliesEndpoint): An endpoint for task document families.
6678
+ task_tags (TaskTagsEndpoint): An endpoint for task tags.
6679
+ tasks (TasksEndpoint): An endpoint for tasks.
6680
+ users (UsersEndpoint): An endpoint for users.
6681
+ workspaces (WorkspacesEndpoint): An endpoint for workspaces.
6641
6682
  """
6642
6683
 
6643
6684
  def __init__(self, url=None, access_token=None, profile=None):
6644
6685
  from kodexa import KodexaPlatform
6686
+ from kodexa.model.entities.product import ProductsEndpoint
6645
6687
 
6646
6688
  self.base_url = url if url is not None else KodexaPlatform.get_url(profile)
6647
6689
  self.access_token = (
@@ -6649,22 +6691,23 @@ class KodexaClient:
6649
6691
  if access_token is not None
6650
6692
  else KodexaPlatform.get_access_token(profile)
6651
6693
  )
6652
- self.organizations = OrganizationsEndpoint(self)
6653
- self.projects = ProjectsEndpoint(self)
6654
- self.workspaces = WorkspacesEndpoint(self)
6655
- self.users = UsersEndpoint(self)
6656
- self.memberships = MembershipsEndpoint(self)
6657
- self.executions = ExecutionsEndpoint(self)
6658
- self.channels = ChannelsEndpoint(self)
6694
+
6659
6695
  self.assistants = AssistantsEndpoint(self)
6660
- self.messages = MessagesEndpoint(self)
6661
- from kodexa.model.entities.product import ProductsEndpoint
6696
+ self.channels = ChannelsEndpoint(self)
6697
+ self.document_families = DocumentFamiliesEndpoint(self)
6698
+ self.executions = ExecutionsEndpoint(self)
6699
+ self.memberships = MembershipsEndpoint(self)
6700
+ self.messages = MessagesEndpoint(self)
6701
+ self.organizations = OrganizationsEndpoint(self)
6662
6702
  self.products = ProductsEndpoint(self)
6663
- self.tasks = TasksEndpoint(self)
6703
+ self.projects = ProjectsEndpoint(self)
6664
6704
  self.retained_guidances = RetainedGuidancesEndpoint(self)
6665
- self.task_document_families = TaskDocumentFamiliesEndpoint(self)
6666
6705
  self.task_activities = TaskActivitiesEndpoint(self)
6706
+ self.task_document_families = TaskDocumentFamiliesEndpoint(self)
6667
6707
  self.task_tags = TaskTagsEndpoint(self)
6708
+ self.tasks = TasksEndpoint(self)
6709
+ self.users = UsersEndpoint(self)
6710
+ self.workspaces = WorkspacesEndpoint(self)
6668
6711
 
6669
6712
  @staticmethod
6670
6713
  def login(url, token):
@@ -7235,36 +7278,36 @@ class KodexaClient:
7235
7278
  from kodexa.model.entities.product_subscription import ProductSubscriptionEndpoint
7236
7279
  from kodexa.model.entities.check_response import CheckResponseEndpoint
7237
7280
  known_components = {
7238
- "taxonomy": TaxonomyEndpoint,
7239
- "pipeline": PipelineEndpoint,
7240
7281
  "action": ActionEndpoint,
7241
- "projectTemplate": ProjectTemplateEndpoint,
7242
- "modelRuntime": ModelRuntimeEndpoint,
7243
- "extensionPack": ExtensionPackEndpoint,
7244
- "user": UserEndpoint,
7245
- "project": ProjectEndpoint,
7246
- "membership": MembershipEndpoint,
7247
- "documentFamily": DocumentFamilyEndpoint,
7248
- "organization": OrganizationEndpoint,
7249
- "dataForm": DataFormEndpoint,
7250
- "dashboard": DashboardEndpoint,
7251
- "execution": ExecutionEndpoint,
7252
7282
  "assistant": AssistantDefinitionEndpoint,
7283
+ "channel": ChannelEndpoint,
7284
+ "checkResponse": CheckResponseEndpoint,
7285
+ "dashboard": DashboardEndpoint,
7286
+ "dataForm": DataFormEndpoint,
7287
+ "documentFamily": DocumentFamilyEndpoint,
7253
7288
  "exception": DataExceptionEndpoint,
7254
- "workspace": WorkspaceEndpoint,
7289
+ "execution": ExecutionEndpoint,
7290
+ "extensionPack": ExtensionPackEndpoint,
7291
+ "guidance": GuidanceSetEndpoint,
7292
+ "membership": MembershipEndpoint,
7255
7293
  "message": MessageEndpoint,
7294
+ "modelRuntime": ModelRuntimeEndpoint,
7295
+ "organization": OrganizationEndpoint,
7296
+ "pipeline": PipelineEndpoint,
7297
+ "product": ProductEndpoint,
7298
+ "productSubscription": ProductSubscriptionEndpoint,
7299
+ "project": ProjectEndpoint,
7300
+ "projectTemplate": ProjectTemplateEndpoint,
7256
7301
  "prompt": PromptEndpoint,
7257
- "guidance": GuidanceSetEndpoint,
7258
7302
  "retainedGuidance": RetainedGuidanceEndpoint,
7259
- "channel": ChannelEndpoint,
7260
- "product": ProductEndpoint,
7261
7303
  "task": TaskEndpoint,
7262
- "productSubscription": ProductSubscriptionEndpoint,
7263
- "checkResponse": CheckResponseEndpoint,
7264
- "taskTemplate": TaskTemplateEndpoint,
7265
- "taskDocumentFamily": TaskDocumentFamilyEndpoint,
7266
7304
  "taskActivity": TaskActivityEndpoint,
7305
+ "taskDocumentFamily": TaskDocumentFamilyEndpoint,
7267
7306
  "taskTag": TaskTagEndpoint,
7307
+ "taskTemplate": TaskTemplateEndpoint,
7308
+ "taxonomy": TaxonomyEndpoint,
7309
+ "user": UserEndpoint,
7310
+ "workspace": WorkspaceEndpoint,
7268
7311
  }
7269
7312
 
7270
7313
  if component_type in known_components:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.4.413710499207
3
+ Version: 7.4.413771246579
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -15,11 +15,11 @@ kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8
15
15
  kodexa/model/model.py,sha256=q3zEm6pPOB-xPCKbOxmTMqLALzmQr2Ppam8knApoSEE,119645
16
16
  kodexa/model/objects.py,sha256=6FH8NTBDBZeFQuofd3XPYbUzqODrsZ7eOcXQvRNEgcM,198797
17
17
  kodexa/model/persistence.py,sha256=jUgQ8xwsAFIoZ_bEynxCDEWhUII42eN0e0Mum0dkQPg,72043
18
- kodexa/model/utils.py,sha256=6R-3rFiW9irBwj0Mq5yhp7EDXkNUFaeFhr3bWmnlW4g,2961
18
+ kodexa/model/utils.py,sha256=YEG3f8YzBil06D0P3_dfx2S9GnHREzyrjnlWwQ7oPlU,3038
19
19
  kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
20
20
  kodexa/pipeline/pipeline.py,sha256=zyNEpA7KlGhPs_l-vgV6m-OCb16dbxQhl8QezeylugA,25540
21
21
  kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
22
- kodexa/platform/client.py,sha256=IEIzvbUmMA98KXnN2csSu7VbF_JYV9MbOjKvZEPiKi8,232704
22
+ kodexa/platform/client.py,sha256=cIqAa5tjZaGJ7yFdRo0v0slCjc9DSMcxkOThF3Xg520,234101
23
23
  kodexa/platform/interaction.py,sha256=6zpcwXKNZstUGNS6m4JsoRXAqCZPJHWI-ZN3co8nnF0,1055
24
24
  kodexa/platform/kodexa.py,sha256=izvvUUkRUNYFZGMiL4DcJpZ4gZznHpxkfbexV0Vn_38,35041
25
25
  kodexa/selectors/__init__.py,sha256=xA9-4vpyaAZWPSk3bh2kvDLkdv6XEmm7PjFbpziiTIk,100
@@ -44,7 +44,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
44
44
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
45
45
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
47
- kodexa-7.4.413710499207.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
- kodexa-7.4.413710499207.dist-info/METADATA,sha256=JUAccf8vJkY9FSBmJFEmWEuWEjiWKZG5clvTk779ReY,2813
49
- kodexa-7.4.413710499207.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
- kodexa-7.4.413710499207.dist-info/RECORD,,
47
+ kodexa-7.4.413771246579.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
+ kodexa-7.4.413771246579.dist-info/METADATA,sha256=EAKz2qnLwSxeRgFB-XjJFs9JX4c9GcQMftFpn1mEnOE,2813
49
+ kodexa-7.4.413771246579.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
+ kodexa-7.4.413771246579.dist-info/RECORD,,