UncountablePythonSDK 0.0.30__py3-none-any.whl → 0.0.33__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.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

Files changed (30) hide show
  1. {UncountablePythonSDK-0.0.30.dist-info → UncountablePythonSDK-0.0.33.dist-info}/METADATA +3 -3
  2. {UncountablePythonSDK-0.0.30.dist-info → UncountablePythonSDK-0.0.33.dist-info}/RECORD +30 -24
  3. {UncountablePythonSDK-0.0.30.dist-info → UncountablePythonSDK-0.0.33.dist-info}/WHEEL +1 -1
  4. docs/requirements.txt +5 -5
  5. pkgs/argument_parser/argument_parser.py +41 -2
  6. pkgs/argument_parser/case_convert.py +4 -3
  7. pkgs/serialization/__init__.py +2 -0
  8. pkgs/serialization/serial_class.py +31 -37
  9. pkgs/serialization/serial_union.py +81 -0
  10. pkgs/serialization_util/__init__.py +1 -7
  11. pkgs/serialization_util/convert_to_snakecase.py +27 -0
  12. pkgs/serialization_util/serialization_helpers.py +48 -59
  13. pkgs/type_spec/builder.py +57 -1
  14. pkgs/type_spec/emit_open_api.py +6 -0
  15. pkgs/type_spec/emit_python.py +23 -0
  16. pkgs/type_spec/emit_typescript.py +6 -0
  17. pkgs/type_spec/type_info/emit_type_info.py +43 -9
  18. uncountable/types/__init__.py +8 -0
  19. uncountable/types/api/entity/list_entities.py +7 -0
  20. uncountable/types/api/inputs/set_intermediate_type.py +43 -0
  21. uncountable/types/api/recipes/add_recipe_to_project.py +35 -0
  22. uncountable/types/api/recipes/associate_recipe_as_input.py +1 -0
  23. uncountable/types/api/recipes/edit_recipe_inputs.py +39 -1
  24. uncountable/types/api/recipes/remove_recipe_from_project.py +35 -0
  25. uncountable/types/api/recipes/set_recipe_outputs.py +2 -0
  26. uncountable/types/client_base.py +72 -0
  27. uncountable/types/inputs.py +1 -0
  28. uncountable/types/recipe_workflow_steps.py +14 -3
  29. uncountable/types/recipes.py +21 -0
  30. {UncountablePythonSDK-0.0.30.dist-info → UncountablePythonSDK-0.0.33.dist-info}/top_level.txt +0 -0
@@ -10,11 +10,13 @@ from decimal import Decimal # noqa: F401
10
10
  from pkgs.strenum_compat import StrEnum
11
11
  from dataclasses import dataclass
12
12
  from pkgs.serialization import serial_class
13
+ from pkgs.serialization import serial_union_annotation
13
14
  from ... import identifier as identifier_t
14
15
  from ... import recipe_inputs as recipe_inputs_t
15
16
  from ... import recipe_workflow_steps as recipe_workflow_steps_t
16
17
 
17
18
  __all__: list[str] = [
19
+ "AnnotationEdit",
18
20
  "Arguments",
19
21
  "Data",
20
22
  "ENDPOINT_METHOD",
@@ -25,6 +27,7 @@ __all__: list[str] = [
25
27
  "RecipeInputEditClearInputs",
26
28
  "RecipeInputEditInputBase",
27
29
  "RecipeInputEditType",
30
+ "RecipeInputEditUpdateAnnotations",
28
31
  "RecipeInputEditUpsertInput",
29
32
  ]
30
33
 
@@ -37,6 +40,7 @@ class RecipeInputEditType(StrEnum):
37
40
  CLEAR_INPUTS = "clear_inputs"
38
41
  UPSERT_INPUT = "upsert_input"
39
42
  ADD_INPUT = "add_input"
43
+ UPDATE_ANNOTATIONS = "update_annotations"
40
44
 
41
45
 
42
46
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -88,7 +92,41 @@ class RecipeInputEditAddInput(RecipeInputEditInputBase):
88
92
 
89
93
 
90
94
  # DO NOT MODIFY -- This file is generated by type_spec
91
- RecipeInputEdit = typing.Union[RecipeInputEditClearInputs, RecipeInputEditUpsertInput, RecipeInputEditAddInput]
95
+ @serial_class(
96
+ to_string_values={"lower_value", "upper_value"},
97
+ )
98
+ @dataclass(kw_only=True)
99
+ class AnnotationEdit:
100
+ annotation_type_key: identifier_t.IdentifierKey
101
+ lower_value: typing.Optional[Decimal] = None
102
+ upper_value: typing.Optional[Decimal] = None
103
+
104
+
105
+ # DO NOT MODIFY -- This file is generated by type_spec
106
+ @serial_class(
107
+ parse_require={"type"},
108
+ )
109
+ @dataclass(kw_only=True)
110
+ class RecipeInputEditUpdateAnnotations(RecipeInputEditInputBase):
111
+ type: typing.Literal[RecipeInputEditType.UPDATE_ANNOTATIONS] = RecipeInputEditType.UPDATE_ANNOTATIONS
112
+ ingredient_key: identifier_t.IdentifierKey
113
+ clear_first: bool
114
+ annotations: list[AnnotationEdit]
115
+
116
+
117
+ # DO NOT MODIFY -- This file is generated by type_spec
118
+ RecipeInputEdit = typing.Annotated[
119
+ typing.Union[RecipeInputEditClearInputs, RecipeInputEditUpsertInput, RecipeInputEditAddInput, RecipeInputEditUpdateAnnotations],
120
+ serial_union_annotation(
121
+ discriminator="type",
122
+ discriminator_map={
123
+ "clear_inputs": RecipeInputEditClearInputs,
124
+ "upsert_input": RecipeInputEditUpsertInput,
125
+ "add_input": RecipeInputEditAddInput,
126
+ "update_annotations": RecipeInputEditUpdateAnnotations,
127
+ },
128
+ ),
129
+ ]
92
130
 
93
131
 
94
132
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,35 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # flake8: noqa: F821
3
+ # ruff: noqa: E402
4
+ # fmt: off
5
+ # isort: skip_file
6
+ from __future__ import annotations
7
+ import typing # noqa: F401
8
+ import datetime # noqa: F401
9
+ from decimal import Decimal # noqa: F401
10
+ from dataclasses import dataclass
11
+ from ... import identifier as identifier_t
12
+
13
+ __all__: list[str] = [
14
+ "Arguments",
15
+ "Data",
16
+ "ENDPOINT_METHOD",
17
+ "ENDPOINT_PATH",
18
+ ]
19
+
20
+ ENDPOINT_METHOD = "POST"
21
+ ENDPOINT_PATH = "api/external/recipes/remove_recipe_from_project"
22
+
23
+
24
+ # DO NOT MODIFY -- This file is generated by type_spec
25
+ @dataclass(kw_only=True)
26
+ class Arguments:
27
+ recipe_key: identifier_t.IdentifierKey
28
+ project_key: identifier_t.IdentifierKey
29
+
30
+
31
+ # DO NOT MODIFY -- This file is generated by type_spec
32
+ @dataclass(kw_only=True)
33
+ class Data:
34
+ pass
35
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -10,6 +10,7 @@ from decimal import Decimal # noqa: F401
10
10
  from dataclasses import dataclass
11
11
  from pkgs.serialization import serial_class
12
12
  from ... import base as base_t
13
+ from ... import recipes as recipes_t
13
14
  from ... import response as response_t
14
15
 
15
16
  __all__: list[str] = [
@@ -45,6 +46,7 @@ class RecipeOutputValue:
45
46
  value_numeric: typing.Optional[Decimal] = None
46
47
  value_str: typing.Optional[str] = None
47
48
  value_curve: typing.Optional[CurveValues] = None
49
+ formatting: typing.Optional[recipes_t.RecipeAttributeFormatting] = None
48
50
 
49
51
 
50
52
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -9,6 +9,7 @@ import typing # noqa: F401
9
9
  import datetime # noqa: F401
10
10
  from decimal import Decimal # noqa: F401
11
11
  from pkgs.serialization import OpaqueKey
12
+ import uncountable.types.api.recipes.add_recipe_to_project as add_recipe_to_project_t
12
13
  import uncountable.types.api.recipes.archive_recipes as archive_recipes_t
13
14
  import uncountable.types.api.recipes.associate_recipe_as_input as associate_recipe_as_input_t
14
15
  import uncountable.types.api.recipes.associate_recipe_as_lot as associate_recipe_as_lot_t
@@ -55,6 +56,7 @@ from uncountable.types import recipe_identifiers as recipe_identifiers_t
55
56
  from uncountable.types import recipe_links as recipe_links_t
56
57
  from uncountable.types import recipe_metadata as recipe_metadata_t
57
58
  from uncountable.types import recipe_workflow_steps as recipe_workflow_steps_t
59
+ import uncountable.types.api.recipes.remove_recipe_from_project as remove_recipe_from_project_t
58
60
  import uncountable.types.api.entity.resolve_entity_ids as resolve_entity_ids_t
59
61
  import uncountable.types.api.outputs.resolve_output_conditions as resolve_output_conditions_t
60
62
  import uncountable.types.api.triggers.run_trigger as run_trigger_t
@@ -62,6 +64,7 @@ import uncountable.types.api.permissions.set_core_permissions as set_core_permis
62
64
  import uncountable.types.api.inputs.set_input_attribute_values as set_input_attribute_values_t
63
65
  import uncountable.types.api.inputs.set_input_category as set_input_category_t
64
66
  import uncountable.types.api.inputs.set_input_subcategories as set_input_subcategories_t
67
+ import uncountable.types.api.inputs.set_intermediate_type as set_intermediate_type_t
65
68
  import uncountable.types.api.recipes.set_recipe_inputs as set_recipe_inputs_t
66
69
  import uncountable.types.api.recipes.set_recipe_metadata as set_recipe_metadata_t
67
70
  import uncountable.types.api.recipes.set_recipe_outputs as set_recipe_outputs_t
@@ -91,6 +94,28 @@ class ClientMethods(ABC):
91
94
  def do_request(self, *, api_request: APIRequest, return_type: type[DT]) -> DT:
92
95
  ...
93
96
 
97
+ def add_recipe_to_project(
98
+ self,
99
+ *,
100
+ recipe_key: identifier_t.IdentifierKey,
101
+ project_key: identifier_t.IdentifierKey,
102
+ ) -> add_recipe_to_project_t.Data:
103
+ """Adds a recipe to a project
104
+
105
+ :param recipe_key: The identifier key of the recipe to add to the project
106
+ :param project_key: The identifier key of the project to add the recipe to
107
+ """
108
+ args = add_recipe_to_project_t.Arguments(
109
+ recipe_key=recipe_key,
110
+ project_key=project_key,
111
+ )
112
+ api_request = APIRequest(
113
+ method=add_recipe_to_project_t.ENDPOINT_METHOD,
114
+ endpoint=add_recipe_to_project_t.ENDPOINT_PATH,
115
+ args=args,
116
+ )
117
+ return self.do_request(api_request=api_request, return_type=add_recipe_to_project_t.Data)
118
+
94
119
  def archive_recipes(
95
120
  self,
96
121
  *,
@@ -118,15 +143,18 @@ class ClientMethods(ABC):
118
143
  *,
119
144
  recipe_key: identifier_t.IdentifierKey,
120
145
  input_key: typing.Optional[identifier_t.IdentifierKey] = None,
146
+ show_in_listings: typing.Optional[bool] = None,
121
147
  ) -> associate_recipe_as_input_t.Data:
122
148
  """Create or return the input association for a recipe
123
149
 
124
150
  :param recipe_key: Identifier for the recipe
125
151
  :param input_key: Identifier for an input to use for the association. Optionally supplied. If not supplied, one is created
152
+ :param show_in_listings: After associating the input should it be present in listings
126
153
  """
127
154
  args = associate_recipe_as_input_t.Arguments(
128
155
  recipe_key=recipe_key,
129
156
  input_key=input_key,
157
+ show_in_listings=show_in_listings,
130
158
  )
131
159
  api_request = APIRequest(
132
160
  method=associate_recipe_as_input_t.ENDPOINT_METHOD,
@@ -900,6 +928,28 @@ class ClientMethods(ABC):
900
928
  )
901
929
  return self.do_request(api_request=api_request, return_type=match_id_source_t.Data)
902
930
 
931
+ def remove_recipe_from_project(
932
+ self,
933
+ *,
934
+ recipe_key: identifier_t.IdentifierKey,
935
+ project_key: identifier_t.IdentifierKey,
936
+ ) -> remove_recipe_from_project_t.Data:
937
+ """Removes a recipe from a project
938
+
939
+ :param recipe_key: The identifier key of the recipe to remove from the project
940
+ :param project_key: The identifier key of the project to remove the recipe from
941
+ """
942
+ args = remove_recipe_from_project_t.Arguments(
943
+ recipe_key=recipe_key,
944
+ project_key=project_key,
945
+ )
946
+ api_request = APIRequest(
947
+ method=remove_recipe_from_project_t.ENDPOINT_METHOD,
948
+ endpoint=remove_recipe_from_project_t.ENDPOINT_PATH,
949
+ args=args,
950
+ )
951
+ return self.do_request(api_request=api_request, return_type=remove_recipe_from_project_t.Data)
952
+
903
953
  def resolve_entity_ids(
904
954
  self,
905
955
  *,
@@ -1059,6 +1109,28 @@ class ClientMethods(ABC):
1059
1109
  )
1060
1110
  return self.do_request(api_request=api_request, return_type=set_input_subcategories_t.Data)
1061
1111
 
1112
+ def set_intermediate_type(
1113
+ self,
1114
+ *,
1115
+ input_key: identifier_t.IdentifierKey,
1116
+ intermediate_type: set_intermediate_type_t.IntermediateType,
1117
+ ) -> set_intermediate_type_t.Data:
1118
+ """Sets the type of an intermediate ingredient.
1119
+
1120
+ :param input_key: The identifier key of the intermediate ingredient
1121
+ :param intermediate_type: The new type of the intermediate ingredient
1122
+ """
1123
+ args = set_intermediate_type_t.Arguments(
1124
+ input_key=input_key,
1125
+ intermediate_type=intermediate_type,
1126
+ )
1127
+ api_request = APIRequest(
1128
+ method=set_intermediate_type_t.ENDPOINT_METHOD,
1129
+ endpoint=set_intermediate_type_t.ENDPOINT_PATH,
1130
+ args=args,
1131
+ )
1132
+ return self.do_request(api_request=api_request, return_type=set_intermediate_type_t.Data)
1133
+
1062
1134
  def set_recipe_inputs(
1063
1135
  self,
1064
1136
  *,
@@ -58,4 +58,5 @@ class SimpleInput:
58
58
  name: str
59
59
  is_parameter: bool
60
60
  intermediate_recipe_id: typing.Optional[base_t.ObjectId]
61
+ input_type: str
61
62
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -10,6 +10,7 @@ from decimal import Decimal # noqa: F401
10
10
  from pkgs.strenum_compat import StrEnum
11
11
  from dataclasses import dataclass
12
12
  from pkgs.serialization import serial_class
13
+ from pkgs.serialization import serial_union_annotation
13
14
  from . import identifier as identifier_t
14
15
 
15
16
  __all__: list[str] = [
@@ -64,14 +65,24 @@ class RecipeWorkflowStepIdentifierWorkflowStep(RecipeWorkflowStepIdentifierBase)
64
65
 
65
66
  # DO NOT MODIFY -- This file is generated by type_spec
66
67
  @serial_class(
67
- parse_require={"key_type"},
68
+ parse_require={"type"},
68
69
  )
69
70
  @dataclass(kw_only=True)
70
71
  class RecipeWorkflowStepIdentifierKey:
71
- key_type: typing.Literal[RecipeWorkflowStepIdentifierType.IDENTIFIER_KEY] = RecipeWorkflowStepIdentifierType.IDENTIFIER_KEY
72
+ type: typing.Literal[RecipeWorkflowStepIdentifierType.IDENTIFIER_KEY] = RecipeWorkflowStepIdentifierType.IDENTIFIER_KEY
72
73
  recipe_workflow_step_key: identifier_t.IdentifierKey
73
74
 
74
75
 
75
76
  # DO NOT MODIFY -- This file is generated by type_spec
76
- RecipeWorkflowStepIdentifier = typing.Union[RecipeWorkflowStepIdentifierDefault, RecipeWorkflowStepIdentifierWorkflowStep, RecipeWorkflowStepIdentifierKey]
77
+ RecipeWorkflowStepIdentifier = typing.Annotated[
78
+ typing.Union[RecipeWorkflowStepIdentifierDefault, RecipeWorkflowStepIdentifierWorkflowStep, RecipeWorkflowStepIdentifierKey],
79
+ serial_union_annotation(
80
+ discriminator="type",
81
+ discriminator_map={
82
+ "default": RecipeWorkflowStepIdentifierDefault,
83
+ "workflow_step": RecipeWorkflowStepIdentifierWorkflowStep,
84
+ "identifier_key": RecipeWorkflowStepIdentifierKey,
85
+ },
86
+ ),
87
+ ]
77
88
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,21 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # flake8: noqa: F821
3
+ # ruff: noqa: E402
4
+ # fmt: off
5
+ # isort: skip_file
6
+ from __future__ import annotations
7
+ import typing # noqa: F401
8
+ import datetime # noqa: F401
9
+ from decimal import Decimal # noqa: F401
10
+ from dataclasses import dataclass
11
+
12
+ __all__: list[str] = [
13
+ "RecipeAttributeFormatting",
14
+ ]
15
+
16
+
17
+ # DO NOT MODIFY -- This file is generated by type_spec
18
+ @dataclass(kw_only=True)
19
+ class RecipeAttributeFormatting:
20
+ background_color: str
21
+ # DO NOT MODIFY -- This file is generated by type_spec