kodexa 7.4.413721143850__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):
@@ -6648,22 +6663,27 @@ class KodexaClient:
6648
6663
  Attributes:
6649
6664
  base_url (str): The base URL for the Kodexa platform.
6650
6665
  access_token (str): The access token for the Kodexa platform.
6651
- organizations (OrganizationsEndpoint): An endpoint for organizations.
6652
- projects (ProjectsEndpoint): An endpoint for projects.
6653
- workspaces (WorkspacesEndpoint): An endpoint for workspaces.
6654
- users (UsersEndpoint): An endpoint for users.
6655
- memberships (MembershipsEndpoint): An endpoint for memberships.
6656
- executions (ExecutionsEndpoint): An endpoint for executions.
6666
+
6667
+ assistants (AssistantsEndpoint): An endpoint for assistants.
6657
6668
  channels (ChannelsEndpoint): An endpoint for channels.
6669
+ executions (ExecutionsEndpoint): An endpoint for executions.
6670
+ memberships (MembershipsEndpoint): An endpoint for memberships.
6658
6671
  messages (MessagesEndpoint): An endpoint for messages.
6659
- assistants (AssistantsEndpoint): An endpoint for assistants.
6672
+ organizations (OrganizationsEndpoint): An endpoint for organizations.
6660
6673
  products (ProductsEndpoint): An endpoint for products.
6661
- tasks (TasksEndpoint): An endpoint for tasks.
6674
+ projects (ProjectsEndpoint): An endpoint for projects.
6662
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.
6663
6682
  """
6664
6683
 
6665
6684
  def __init__(self, url=None, access_token=None, profile=None):
6666
6685
  from kodexa import KodexaPlatform
6686
+ from kodexa.model.entities.product import ProductsEndpoint
6667
6687
 
6668
6688
  self.base_url = url if url is not None else KodexaPlatform.get_url(profile)
6669
6689
  self.access_token = (
@@ -6671,23 +6691,23 @@ class KodexaClient:
6671
6691
  if access_token is not None
6672
6692
  else KodexaPlatform.get_access_token(profile)
6673
6693
  )
6674
- self.organizations = OrganizationsEndpoint(self)
6675
- self.projects = ProjectsEndpoint(self)
6676
- self.workspaces = WorkspacesEndpoint(self)
6677
- self.users = UsersEndpoint(self)
6678
- self.memberships = MembershipsEndpoint(self)
6679
- self.executions = ExecutionsEndpoint(self)
6680
- self.channels = ChannelsEndpoint(self)
6694
+
6681
6695
  self.assistants = AssistantsEndpoint(self)
6682
- self.messages = MessagesEndpoint(self)
6683
- 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)
6684
6702
  self.products = ProductsEndpoint(self)
6685
- self.tasks = TasksEndpoint(self)
6703
+ self.projects = ProjectsEndpoint(self)
6686
6704
  self.retained_guidances = RetainedGuidancesEndpoint(self)
6687
- self.task_document_families = TaskDocumentFamiliesEndpoint(self)
6688
6705
  self.task_activities = TaskActivitiesEndpoint(self)
6706
+ self.task_document_families = TaskDocumentFamiliesEndpoint(self)
6689
6707
  self.task_tags = TaskTagsEndpoint(self)
6690
- self.document_families = DocumentFamiliesEndpoint(self)
6708
+ self.tasks = TasksEndpoint(self)
6709
+ self.users = UsersEndpoint(self)
6710
+ self.workspaces = WorkspacesEndpoint(self)
6691
6711
 
6692
6712
  @staticmethod
6693
6713
  def login(url, token):
@@ -7258,36 +7278,36 @@ class KodexaClient:
7258
7278
  from kodexa.model.entities.product_subscription import ProductSubscriptionEndpoint
7259
7279
  from kodexa.model.entities.check_response import CheckResponseEndpoint
7260
7280
  known_components = {
7261
- "taxonomy": TaxonomyEndpoint,
7262
- "pipeline": PipelineEndpoint,
7263
7281
  "action": ActionEndpoint,
7264
- "projectTemplate": ProjectTemplateEndpoint,
7265
- "modelRuntime": ModelRuntimeEndpoint,
7266
- "extensionPack": ExtensionPackEndpoint,
7267
- "user": UserEndpoint,
7268
- "project": ProjectEndpoint,
7269
- "membership": MembershipEndpoint,
7270
- "documentFamily": DocumentFamilyEndpoint,
7271
- "organization": OrganizationEndpoint,
7272
- "dataForm": DataFormEndpoint,
7273
- "dashboard": DashboardEndpoint,
7274
- "execution": ExecutionEndpoint,
7275
7282
  "assistant": AssistantDefinitionEndpoint,
7283
+ "channel": ChannelEndpoint,
7284
+ "checkResponse": CheckResponseEndpoint,
7285
+ "dashboard": DashboardEndpoint,
7286
+ "dataForm": DataFormEndpoint,
7287
+ "documentFamily": DocumentFamilyEndpoint,
7276
7288
  "exception": DataExceptionEndpoint,
7277
- "workspace": WorkspaceEndpoint,
7289
+ "execution": ExecutionEndpoint,
7290
+ "extensionPack": ExtensionPackEndpoint,
7291
+ "guidance": GuidanceSetEndpoint,
7292
+ "membership": MembershipEndpoint,
7278
7293
  "message": MessageEndpoint,
7294
+ "modelRuntime": ModelRuntimeEndpoint,
7295
+ "organization": OrganizationEndpoint,
7296
+ "pipeline": PipelineEndpoint,
7297
+ "product": ProductEndpoint,
7298
+ "productSubscription": ProductSubscriptionEndpoint,
7299
+ "project": ProjectEndpoint,
7300
+ "projectTemplate": ProjectTemplateEndpoint,
7279
7301
  "prompt": PromptEndpoint,
7280
- "guidance": GuidanceSetEndpoint,
7281
7302
  "retainedGuidance": RetainedGuidanceEndpoint,
7282
- "channel": ChannelEndpoint,
7283
- "product": ProductEndpoint,
7284
7303
  "task": TaskEndpoint,
7285
- "productSubscription": ProductSubscriptionEndpoint,
7286
- "checkResponse": CheckResponseEndpoint,
7287
- "taskTemplate": TaskTemplateEndpoint,
7288
- "taskDocumentFamily": TaskDocumentFamilyEndpoint,
7289
7304
  "taskActivity": TaskActivityEndpoint,
7305
+ "taskDocumentFamily": TaskDocumentFamilyEndpoint,
7290
7306
  "taskTag": TaskTagEndpoint,
7307
+ "taskTemplate": TaskTemplateEndpoint,
7308
+ "taxonomy": TaxonomyEndpoint,
7309
+ "user": UserEndpoint,
7310
+ "workspace": WorkspaceEndpoint,
7291
7311
  }
7292
7312
 
7293
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.413721143850
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=q72I6ehDpWl1y5350QMdX1sBrDQ1qHAXhBj5PgacCOc,233347
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.413721143850.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
- kodexa-7.4.413721143850.dist-info/METADATA,sha256=GXOmMNlNTRNtdcCyMfPqj_TGngDAYzSXzj7XPZXVcX8,2813
49
- kodexa-7.4.413721143850.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
- kodexa-7.4.413721143850.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,,