kodexa 7.0.8790901211__tar.gz → 7.0.8895840398__tar.gz

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.
Files changed (43) hide show
  1. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/PKG-INFO +1 -1
  2. kodexa-7.0.8895840398/kodexa/model/entities/product.py +127 -0
  3. kodexa-7.0.8895840398/kodexa/model/entities/product_subscription.py +123 -0
  4. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/model/model.py +2 -2
  5. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/model/objects.py +4 -7
  6. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/platform/client.py +36 -0
  7. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/platform/kodexa.py +4 -0
  8. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/pyproject.toml +1 -1
  9. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/LICENSE +0 -0
  10. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/README.md +0 -0
  11. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/__init__.py +0 -0
  12. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/assistant/__init__.py +0 -0
  13. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/assistant/assistant.py +0 -0
  14. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/connectors/__init__.py +0 -0
  15. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/connectors/connectors.py +0 -0
  16. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/model/__init__.py +0 -0
  17. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/model/base.py +0 -0
  18. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/model/persistence.py +0 -0
  19. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/pipeline/__init__.py +0 -0
  20. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/pipeline/pipeline.py +0 -0
  21. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/platform/__init__.py +0 -0
  22. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/platform/interaction.py +0 -0
  23. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/__init__.py +0 -0
  24. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/ast.py +0 -0
  25. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/core.py +0 -0
  26. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/lexrules.py +0 -0
  27. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/lextab.py +0 -0
  28. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/lextab.pyi +0 -0
  29. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/parserules.py +0 -0
  30. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/parserules.pyi +0 -0
  31. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/parsetab.py +0 -0
  32. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/selectors/parsetab.pyi +0 -0
  33. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/spatial/__init__.py +0 -0
  34. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/spatial/azure_models.py +0 -0
  35. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/spatial/bbox_common.py +0 -0
  36. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/spatial/table_form_common.py +0 -0
  37. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/steps/__init__.py +0 -0
  38. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/steps/common.py +0 -0
  39. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/testing/__init__.py +0 -0
  40. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/testing/test_components.py +0 -0
  41. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/testing/test_utils.py +0 -0
  42. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/training/__init__.py +0 -0
  43. {kodexa-7.0.8790901211 → kodexa-7.0.8895840398}/kodexa/training/train_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.0.8790901211
3
+ Version: 7.0.8895840398
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -0,0 +1,127 @@
1
+ from dataclasses import Field
2
+ from typing import Optional, List
3
+
4
+ from pydantic import BaseModel, ConfigDict
5
+
6
+ from kodexa.model.base import StandardDateTime
7
+ from kodexa.platform.client import EntityEndpoint, PageEndpoint, EntitiesEndpoint
8
+
9
+
10
+ class Product(BaseModel):
11
+ """
12
+
13
+ """
14
+ model_config = ConfigDict(
15
+ populate_by_name=True,
16
+ use_enum_values=True,
17
+ arbitrary_types_allowed=True,
18
+ protected_namespaces=("model_config",),
19
+ )
20
+ """
21
+ A product
22
+ """
23
+
24
+ id: Optional[str] = Field(None, description="The ID of the object")
25
+ uuid: Optional[str] = None
26
+ change_sequence: Optional[int] = Field(None, alias="changeSequence")
27
+ created_on: Optional[StandardDateTime] = Field(None, alias="createdOn")
28
+ updated_on: Optional[StandardDateTime] = Field(None, alias="updatedOn")
29
+ name: str
30
+ description: Optional[str] = None
31
+ overview_markdown: Optional[str] = Field(None, alias="overviewMarkdown")
32
+
33
+
34
+ class ProductEndpoint(Product, EntityEndpoint):
35
+ """Handles the endpoint for a product
36
+
37
+ This class is a combination of DataException and EntityEndpoint. It is used
38
+ to manage the endpoint for data exceptions.
39
+
40
+ Methods:
41
+ get_type: Returns the type of the endpoint.
42
+ """
43
+
44
+ def get_type(self) -> str:
45
+ """Gets the type of the endpoint.
46
+
47
+ This method returns the type of the endpoint which is "exceptions".
48
+
49
+ Returns:
50
+ str: The type of the endpoint.
51
+ """
52
+ return "products"
53
+
54
+
55
+ class PageProduct(BaseModel):
56
+ """
57
+
58
+ """
59
+ model_config = ConfigDict(
60
+ populate_by_name=True,
61
+ use_enum_values=True,
62
+ arbitrary_types_allowed=True,
63
+ protected_namespaces=("model_config",),
64
+ )
65
+ total_pages: Optional[int] = Field(None, alias="totalPages")
66
+ total_elements: Optional[int] = Field(None, alias="totalElements")
67
+ size: Optional[int] = None
68
+ content: Optional[List[Product]] = None
69
+ number: Optional[int] = None
70
+
71
+ number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
72
+ first: Optional[bool] = None
73
+ last: Optional[bool] = None
74
+ empty: Optional[bool] = None
75
+
76
+
77
+ class PageProductEndpoint(PageProduct, PageEndpoint):
78
+ def get_type(self) -> Optional[str]:
79
+ return "product"
80
+
81
+
82
+ class ProductsEndpoint(EntitiesEndpoint):
83
+ """Represents the products endpoint
84
+
85
+ This class is used to represent the products endpoint in the system.
86
+
87
+ Attributes:
88
+ object_dict: A dictionary containing the object data.
89
+ """
90
+
91
+ """Represents a assistants endpoint"""
92
+
93
+ def get_type(self) -> str:
94
+ """Get the type of the endpoint
95
+
96
+ This method is used to get the type of the endpoint.
97
+
98
+ Returns:
99
+ str: The type of the endpoint.
100
+ """
101
+ return "products"
102
+
103
+ def get_instance_class(self, object_dict=None):
104
+ """Get the instance class of the endpoint
105
+
106
+ This method is used to get the instance class of the endpoint.
107
+
108
+ Args:
109
+ object_dict (dict, optional): A dictionary containing the object data.
110
+
111
+ Returns:
112
+ AssistantEndpoint: The instance class of the endpoint.
113
+ """
114
+ return ProductEndpoint
115
+
116
+ def get_page_class(self, object_dict=None):
117
+ """Get the page class of the endpoint
118
+
119
+ This method is used to get the page class of the endpoint.
120
+
121
+ Args:
122
+ object_dict (dict, optional): A dictionary containing the object data.
123
+
124
+ Returns:
125
+ PageAssistantEndpoint: The page class of the endpoint.
126
+ """
127
+ return PageProductEndpoint
@@ -0,0 +1,123 @@
1
+ from dataclasses import Field
2
+ from typing import Optional, List
3
+
4
+ from pydantic import BaseModel, ConfigDict
5
+
6
+ from kodexa.model.base import StandardDateTime
7
+ from kodexa.model.entities.product import Product
8
+ from kodexa.model.objects import Organization
9
+ from kodexa.platform.client import EntityEndpoint, PageEndpoint, EntitiesEndpoint
10
+
11
+
12
+ class ProductSubscription(BaseModel):
13
+ """
14
+ A product subscription
15
+ """
16
+ model_config = ConfigDict(
17
+ populate_by_name=True,
18
+ use_enum_values=True,
19
+ arbitrary_types_allowed=True,
20
+ protected_namespaces=("model_config",),
21
+ )
22
+
23
+ id: Optional[str] = Field(None, description="The ID of the object")
24
+ uuid: Optional[str] = None
25
+ change_sequence: Optional[int] = Field(None, alias="changeSequence")
26
+ created_on: Optional[StandardDateTime] = Field(None, alias="createdOn")
27
+ updated_on: Optional[StandardDateTime] = Field(None, alias="updatedOn")
28
+ product: Optional[Product] = None
29
+ organization: Optional[Organization] = None
30
+
31
+
32
+ class ProductSubscriptionEndpoint(ProductSubscription, EntityEndpoint):
33
+ """Handles the endpoint for a product subscription
34
+
35
+ This class is a combination of ProductSubscription and EntityEndpoint. It is used
36
+ to manage the endpoint for product subscriptions.
37
+
38
+ Methods:
39
+ get_type: Returns the type of the endpoint.
40
+ """
41
+
42
+ def get_type(self) -> str:
43
+ """Gets the type of the endpoint.
44
+
45
+ This method returns the type of the endpoint which is "product_subscriptions".
46
+
47
+ Returns:
48
+ str: The type of the endpoint.
49
+ """
50
+ return "product_subscriptions"
51
+
52
+
53
+ class PageProductSubscription(BaseModel):
54
+ """
55
+ A page of product subscriptions
56
+ """
57
+ model_config = ConfigDict(
58
+ populate_by_name=True,
59
+ use_enum_values=True,
60
+ arbitrary_types_allowed=True,
61
+ protected_namespaces=("model_config",),
62
+ )
63
+ total_pages: Optional[int] = Field(None, alias="totalPages")
64
+ total_elements: Optional[int] = Field(None, alias="totalElements")
65
+ size: Optional[int] = None
66
+ content: Optional[List[ProductSubscription]] = None
67
+ number: Optional[int] = None
68
+
69
+ number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
70
+ first: Optional[bool] = None
71
+ last: Optional[bool] = None
72
+ empty: Optional[bool] = None
73
+
74
+
75
+ class PageProductSubscriptionEndpoint(PageProductSubscription, PageEndpoint):
76
+ def get_type(self) -> Optional[str]:
77
+ return "product_subscription"
78
+
79
+
80
+ class ProductSubscriptionsEndpoint(EntitiesEndpoint):
81
+ """Represents the product subscriptions endpoint
82
+
83
+ This class is used to represent the product subscriptions endpoint in the system.
84
+
85
+ Attributes:
86
+ object_dict: A dictionary containing the object data.
87
+ """
88
+
89
+ def get_type(self) -> str:
90
+ """Get the type of the endpoint
91
+
92
+ This method is used to get the type of the endpoint.
93
+
94
+ Returns:
95
+ str: The type of the endpoint.
96
+ """
97
+ return "product_subscriptions"
98
+
99
+ def get_instance_class(self, object_dict=None):
100
+ """Get the instance class of the endpoint
101
+
102
+ This method is used to get the instance class of the endpoint.
103
+
104
+ Args:
105
+ object_dict (dict, optional): A dictionary containing the object data.
106
+
107
+ Returns:
108
+ ProductSubscriptionEndpoint: The instance class of the endpoint.
109
+ """
110
+ return ProductSubscriptionEndpoint
111
+
112
+ def get_page_class(self, object_dict=None):
113
+ """Get the page class of the endpoint
114
+
115
+ This method is used to get the page class of the endpoint.
116
+
117
+ Args:
118
+ object_dict (dict, optional): A dictionary containing the object data.
119
+
120
+ Returns:
121
+ PageProductSubscriptionEndpoint: The page class of the endpoint.
122
+ """
123
+ return PageProductSubscriptionEndpoint
@@ -2631,7 +2631,7 @@ class Document(object):
2631
2631
  return self
2632
2632
 
2633
2633
  @classmethod
2634
- def from_text(cls, text, separator=None):
2634
+ def from_text(cls, text, separator=None, inmemory=False):
2635
2635
  """Creates a new Document from the text provided.
2636
2636
 
2637
2637
  Args:
@@ -2642,7 +2642,7 @@ class Document(object):
2642
2642
  the document
2643
2643
 
2644
2644
  """
2645
- new_document = Document()
2645
+ new_document = Document(inmemory=inmemory)
2646
2646
  new_document.source.original_filename = f"text-{uuid.uuid4()}"
2647
2647
  new_document.content_node = new_document.create_node(node_type="text", index=0)
2648
2648
  if text:
@@ -675,9 +675,8 @@ class StorePurpose(Enum):
675
675
 
676
676
 
677
677
  class ProjectStoreFile(BaseModel):
678
-
679
678
  url: Optional[str] = None
680
- metadata: Optional[Dict[str,str]] = None
679
+ metadata: Optional[Dict[str, str]] = None
681
680
 
682
681
 
683
682
  class ProjectStore(BaseModel):
@@ -1772,6 +1771,7 @@ class DeploymentOptions(BaseModel):
1772
1771
  cpu: Optional[str] = None
1773
1772
  pod_match_labels: Optional[List[MatchLabel]] = Field(None, alias="podMatchLabels")
1774
1773
  child_process: Optional[bool] = Field(None, alias="childProcess")
1774
+ layers: Optional[List[str]] = None
1775
1775
 
1776
1776
 
1777
1777
  class SourceType(Enum):
@@ -2490,7 +2490,6 @@ class ProjectAssistant(BaseModel):
2490
2490
 
2491
2491
 
2492
2492
  class TaxonConditionalFormat(BaseModel):
2493
-
2494
2493
  model_config = ConfigDict(
2495
2494
  populate_by_name=True,
2496
2495
  use_enum_values=True,
@@ -2504,7 +2503,6 @@ class TaxonConditionalFormat(BaseModel):
2504
2503
 
2505
2504
 
2506
2505
  class TaxonCardinality(Enum):
2507
-
2508
2506
  once_per_document = "ONCE_PER_DOCUMENT"
2509
2507
  multiple_per_document = "MULTIPLE_PER_DOCUMENT"
2510
2508
  once_per_segment = "ONCE_PER_SEGMENT"
@@ -2809,7 +2807,6 @@ class ProjectStatus(BaseModel):
2809
2807
 
2810
2808
 
2811
2809
  class ProjectOptions(BaseModel):
2812
-
2813
2810
  model_config = ConfigDict(
2814
2811
  populate_by_name=True,
2815
2812
  use_enum_values=True,
@@ -3840,7 +3837,6 @@ class LabelStatistics(BaseModel):
3840
3837
 
3841
3838
 
3842
3839
  class DocumentEmbedding(BaseModel):
3843
-
3844
3840
  model_config = ConfigDict(
3845
3841
  populate_by_name=True,
3846
3842
  use_enum_values=True,
@@ -4074,6 +4070,7 @@ class Assistant(BaseModel):
4074
4070
  chat_enabled: Optional[bool] = Field(None, alias="chatEnabled")
4075
4071
  assistant_role: Optional[str] = Field(None, alias="assistantRole")
4076
4072
 
4073
+
4077
4074
  class AssistantExecution(BaseModel):
4078
4075
  """
4079
4076
 
@@ -4339,6 +4336,7 @@ class Guidance(BaseModel):
4339
4336
 
4340
4337
  guidance_options: Optional[List[Option]] = Field(None, alias="guidanceOptions")
4341
4338
 
4339
+
4342
4340
  class GuidanceSet(ExtensionPackProvided):
4343
4341
  """
4344
4342
 
@@ -5262,7 +5260,6 @@ class Pipeline(ExtensionPackProvided):
5262
5260
 
5263
5261
 
5264
5262
  class ProjectTemplate(ExtensionPackProvided):
5265
-
5266
5263
  stores: Optional[List[ProjectStore]] = Field(
5267
5264
  None, description="The stores that will be created with the project template"
5268
5265
  )
@@ -1598,6 +1598,42 @@ class OrganizationEndpoint(Organization, EntityEndpoint):
1598
1598
  """
1599
1599
  return TaxonomiesEndpoint().set_client(self.client).set_organization(self)
1600
1600
 
1601
+ @property
1602
+ def available_templates(self, page=1, page_size=10, query="*"):
1603
+ """
1604
+ Get the available templates for the organization.
1605
+
1606
+ Returns:
1607
+ MarketplaceEndpoint: The marketplace endpoint of the organization.
1608
+ """
1609
+ url = f"/api/organizations/{self.id}/availableTemplates"
1610
+ response = self.client.get(url, params={"page": page, "pageSize": page_size, "query": query})
1611
+ return PageProjectTemplateEndpoint.model_validate(response.json()).set_client(self.client)
1612
+
1613
+ @property
1614
+ def available_models(self, page=1, page_size=10, query="*"):
1615
+ """
1616
+ Get the available models for the organization.
1617
+
1618
+ Returns:
1619
+ MarketplaceEndpoint: The marketplace endpoint of the organization.
1620
+ """
1621
+ url = f"/api/organizations/{self.id}/availableModels"
1622
+ response = self.client.get(url, params={"page": page, "pageSize": page_size, "query": query})
1623
+ return PageStoreEndpoint.model_validate(response.json()).set_client(self.client)
1624
+
1625
+ @property
1626
+ def available_assistants(self, page=1, page_size=10, query="*"):
1627
+ """
1628
+ Get the available assistants for the organization.
1629
+
1630
+ Returns:
1631
+ MarketplaceEndpoint: The marketplace endpoint of the organization.
1632
+ """
1633
+ url = f"/api/organizations/{self.id}/availableAssistants"
1634
+ response = self.client.get(url, params={"page": page, "pageSize": page_size, "query": query})
1635
+ return PageAssistantDefinitionEndpoint.model_validate(response.json()).set_client(self.client)
1636
+
1601
1637
 
1602
1638
  class ComponentsEndpoint(ClientEndpoint):
1603
1639
  """
@@ -307,6 +307,10 @@ class KodexaPlatform:
307
307
  )
308
308
  if obj_response.status_code == 200:
309
309
  kodexa_config = get_config(profile, create=True)
310
+
311
+ if profile not in kodexa_config:
312
+ kodexa_config[profile] = {}
313
+
310
314
  kodexa_config[profile]["url"] = kodexa_url
311
315
  kodexa_config[profile]["access_token"] = token
312
316
  save_config(kodexa_config)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kodexa"
3
- version = "7.0.08790901211"
3
+ version = "7.0.08895840398"
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"
File without changes