UncountablePythonSDK 0.0.40__py3-none-any.whl → 0.0.42__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 (127) hide show
  1. {UncountablePythonSDK-0.0.40.dist-info → UncountablePythonSDK-0.0.42.dist-info}/METADATA +5 -1
  2. {UncountablePythonSDK-0.0.40.dist-info → UncountablePythonSDK-0.0.42.dist-info}/RECORD +126 -107
  3. docs/requirements.txt +3 -3
  4. examples/invoke_uploader.py +23 -0
  5. pkgs/argument_parser/argument_parser.py +2 -2
  6. pkgs/filesystem_utils/__init__.py +17 -0
  7. pkgs/filesystem_utils/_gdrive_session.py +306 -0
  8. pkgs/filesystem_utils/_local_session.py +69 -0
  9. pkgs/filesystem_utils/_sftp_session.py +147 -0
  10. pkgs/filesystem_utils/file_type_utils.py +61 -0
  11. pkgs/filesystem_utils/filesystem_session.py +39 -0
  12. pkgs/serialization/yaml.py +54 -0
  13. pkgs/type_spec/config.py +1 -13
  14. pkgs/type_spec/emit_open_api.py +7 -5
  15. pkgs/type_spec/emit_open_api_util.py +4 -2
  16. pkgs/type_spec/emit_python.py +13 -14
  17. pkgs/type_spec/load_types.py +2 -1
  18. pkgs/type_spec/value_spec/__main__.py +1 -1
  19. uncountable/core/file_upload.py +13 -3
  20. uncountable/integration/construct_client.py +1 -1
  21. uncountable/integration/cron.py +11 -6
  22. uncountable/integration/entrypoint.py +6 -7
  23. uncountable/integration/executors/executors.py +24 -0
  24. uncountable/integration/executors/generic_upload_executor.py +245 -0
  25. uncountable/integration/executors/script_executor.py +1 -1
  26. uncountable/integration/job.py +19 -2
  27. uncountable/integration/secret_retrieval/__init__.py +3 -0
  28. uncountable/integration/secret_retrieval/retrieve_secret.py +40 -0
  29. uncountable/integration/server.py +1 -1
  30. uncountable/types/__init__.py +8 -0
  31. uncountable/types/api/batch/execute_batch.py +5 -5
  32. uncountable/types/api/batch/execute_batch_load_async.py +3 -3
  33. uncountable/types/api/chemical/convert_chemical_formats.py +4 -4
  34. uncountable/types/api/entity/create_entities.py +4 -4
  35. uncountable/types/api/entity/create_entity.py +4 -4
  36. uncountable/types/api/entity/get_entities_data.py +4 -4
  37. uncountable/types/api/entity/list_entities.py +5 -5
  38. uncountable/types/api/entity/lock_entity.py +3 -3
  39. uncountable/types/api/entity/resolve_entity_ids.py +4 -4
  40. uncountable/types/api/entity/set_values.py +3 -3
  41. uncountable/types/api/entity/transition_entity_phase.py +5 -5
  42. uncountable/types/api/entity/unlock_entity.py +3 -3
  43. uncountable/types/api/equipment/associate_equipment_input.py +3 -3
  44. uncountable/types/api/field_options/upsert_field_options.py +4 -4
  45. uncountable/types/api/id_source/list_id_source.py +4 -4
  46. uncountable/types/api/id_source/match_id_source.py +4 -4
  47. uncountable/types/api/input_groups/get_input_group_names.py +4 -4
  48. uncountable/types/api/inputs/create_inputs.py +5 -5
  49. uncountable/types/api/inputs/get_input_data.py +7 -7
  50. uncountable/types/api/inputs/get_input_names.py +4 -4
  51. uncountable/types/api/inputs/get_inputs_data.py +7 -7
  52. uncountable/types/api/inputs/set_input_attribute_values.py +4 -4
  53. uncountable/types/api/inputs/set_input_category.py +3 -3
  54. uncountable/types/api/inputs/set_input_subcategories.py +3 -3
  55. uncountable/types/api/inputs/set_intermediate_type.py +3 -3
  56. uncountable/types/api/material_families/update_entity_material_families.py +3 -3
  57. uncountable/types/api/outputs/get_output_data.py +7 -7
  58. uncountable/types/api/outputs/get_output_names.py +4 -4
  59. uncountable/types/api/outputs/resolve_output_conditions.py +6 -6
  60. uncountable/types/api/permissions/set_core_permissions.py +7 -7
  61. uncountable/types/api/project/get_projects.py +4 -4
  62. uncountable/types/api/project/get_projects_data.py +4 -4
  63. uncountable/types/api/recipe_links/create_recipe_link.py +3 -3
  64. uncountable/types/api/recipe_links/remove_recipe_link.py +3 -3
  65. uncountable/types/api/recipe_metadata/get_recipe_metadata_data.py +4 -4
  66. uncountable/types/api/recipes/add_recipe_to_project.py +3 -3
  67. uncountable/types/api/recipes/archive_recipes.py +3 -3
  68. uncountable/types/api/recipes/associate_recipe_as_input.py +3 -3
  69. uncountable/types/api/recipes/associate_recipe_as_lot.py +3 -3
  70. uncountable/types/api/recipes/create_recipe.py +3 -3
  71. uncountable/types/api/recipes/create_recipes.py +5 -5
  72. uncountable/types/api/recipes/disassociate_recipe_as_input.py +3 -3
  73. uncountable/types/api/recipes/edit_recipe_inputs.py +12 -12
  74. uncountable/types/api/recipes/get_curve.py +3 -3
  75. uncountable/types/api/recipes/get_recipe_calculations.py +4 -4
  76. uncountable/types/api/recipes/get_recipe_links.py +3 -3
  77. uncountable/types/api/recipes/get_recipe_names.py +4 -4
  78. uncountable/types/api/recipes/get_recipe_output_metadata.py +4 -4
  79. uncountable/types/api/recipes/get_recipes_data.py +12 -12
  80. uncountable/types/api/recipes/lock_recipes.py +4 -4
  81. uncountable/types/api/recipes/remove_recipe_from_project.py +3 -3
  82. uncountable/types/api/recipes/set_recipe_inputs.py +4 -4
  83. uncountable/types/api/recipes/set_recipe_metadata.py +3 -3
  84. uncountable/types/api/recipes/set_recipe_output_annotations.py +7 -7
  85. uncountable/types/api/recipes/set_recipe_outputs.py +5 -5
  86. uncountable/types/api/recipes/set_recipe_tags.py +7 -7
  87. uncountable/types/api/recipes/unarchive_recipes.py +3 -3
  88. uncountable/types/api/recipes/unlock_recipes.py +3 -3
  89. uncountable/types/api/triggers/run_trigger.py +3 -3
  90. uncountable/types/api/uploader/__init__.py +1 -0
  91. uncountable/types/api/uploader/invoke_uploader.py +38 -0
  92. uncountable/types/async_batch_processor.py +36 -0
  93. uncountable/types/async_batch_t.py +6 -4
  94. uncountable/types/calculations_t.py +2 -2
  95. uncountable/types/chemical_structure_t.py +2 -2
  96. uncountable/types/client_base.py +25 -2
  97. uncountable/types/curves_t.py +3 -3
  98. uncountable/types/entity_t.py +2 -2
  99. uncountable/types/experiment_groups_t.py +2 -2
  100. uncountable/types/field_values_t.py +5 -5
  101. uncountable/types/fields_t.py +2 -2
  102. uncountable/types/generic_upload.py +9 -0
  103. uncountable/types/generic_upload_t.py +41 -0
  104. uncountable/types/id_source_t.py +5 -5
  105. uncountable/types/identifier_t.py +4 -4
  106. uncountable/types/input_attributes_t.py +2 -2
  107. uncountable/types/inputs_t.py +2 -2
  108. uncountable/types/job_definition.py +26 -0
  109. uncountable/types/job_definition_t.py +203 -0
  110. uncountable/types/outputs_t.py +2 -2
  111. uncountable/types/phases_t.py +2 -2
  112. uncountable/types/recipe_identifiers_t.py +4 -4
  113. uncountable/types/recipe_links_t.py +2 -2
  114. uncountable/types/recipe_metadata_t.py +4 -4
  115. uncountable/types/recipe_output_metadata_t.py +2 -2
  116. uncountable/types/recipe_tags_t.py +2 -2
  117. uncountable/types/recipe_workflow_steps_t.py +5 -5
  118. uncountable/types/recipes_t.py +2 -2
  119. uncountable/types/response_t.py +2 -2
  120. uncountable/types/secret_retrieval.py +12 -0
  121. uncountable/types/secret_retrieval_t.py +69 -0
  122. uncountable/types/units_t.py +2 -2
  123. uncountable/types/users_t.py +2 -2
  124. uncountable/types/workflows_t.py +3 -3
  125. uncountable/integration/types.py +0 -89
  126. {UncountablePythonSDK-0.0.40.dist-info → UncountablePythonSDK-0.0.42.dist-info}/WHEEL +0 -0
  127. {UncountablePythonSDK-0.0.40.dist-info → UncountablePythonSDK-0.0.42.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,69 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # flake8: noqa: F821
3
+ # ruff: noqa: E402 Q003
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 pkgs.strenum_compat import StrEnum
11
+ import dataclasses
12
+ from pkgs.serialization import serial_class
13
+ from pkgs.serialization import serial_union_annotation
14
+
15
+ __all__: list[str] = [
16
+ "SecretRetrieval",
17
+ "SecretRetrievalAWS",
18
+ "SecretRetrievalBase",
19
+ "SecretRetrievalEnv",
20
+ "SecretRetrievalType",
21
+ ]
22
+
23
+
24
+ # DO NOT MODIFY -- This file is generated by type_spec
25
+ @dataclasses.dataclass(kw_only=True)
26
+ class SecretRetrievalBase:
27
+ type: SecretRetrievalType
28
+
29
+
30
+ # DO NOT MODIFY -- This file is generated by type_spec
31
+ class SecretRetrievalType(StrEnum):
32
+ ENV = "env"
33
+ AWS = "aws"
34
+
35
+
36
+ # DO NOT MODIFY -- This file is generated by type_spec
37
+ @serial_class(
38
+ parse_require={"type"},
39
+ )
40
+ @dataclasses.dataclass(kw_only=True)
41
+ class SecretRetrievalEnv(SecretRetrievalBase):
42
+ type: typing.Literal[SecretRetrievalType.ENV] = SecretRetrievalType.ENV
43
+ env_key: str
44
+
45
+
46
+ # DO NOT MODIFY -- This file is generated by type_spec
47
+ @serial_class(
48
+ parse_require={"type"},
49
+ )
50
+ @dataclasses.dataclass(kw_only=True)
51
+ class SecretRetrievalAWS(SecretRetrievalBase):
52
+ type: typing.Literal[SecretRetrievalType.AWS] = SecretRetrievalType.AWS
53
+ secret_name: str
54
+ region: str
55
+ sub_key: typing.Optional[str] = None
56
+
57
+
58
+ # DO NOT MODIFY -- This file is generated by type_spec
59
+ SecretRetrieval = typing.Annotated[
60
+ typing.Union[SecretRetrievalEnv, SecretRetrievalAWS],
61
+ serial_union_annotation(
62
+ discriminator="type",
63
+ discriminator_map={
64
+ "env": SecretRetrievalEnv,
65
+ "aws": SecretRetrievalAWS,
66
+ },
67
+ ),
68
+ ]
69
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -7,7 +7,7 @@ from __future__ import annotations
7
7
  import typing # noqa: F401
8
8
  import datetime # noqa: F401
9
9
  from decimal import Decimal # noqa: F401
10
- from dataclasses import dataclass
10
+ import dataclasses
11
11
  from . import base_t
12
12
 
13
13
  __all__: list[str] = [
@@ -16,7 +16,7 @@ __all__: list[str] = [
16
16
 
17
17
 
18
18
  # DO NOT MODIFY -- This file is generated by type_spec
19
- @dataclass(kw_only=True)
19
+ @dataclasses.dataclass(kw_only=True)
20
20
  class SimpleUnit:
21
21
  unit_id: base_t.ObjectId
22
22
  name: str
@@ -7,7 +7,7 @@ from __future__ import annotations
7
7
  import typing # noqa: F401
8
8
  import datetime # noqa: F401
9
9
  from decimal import Decimal # noqa: F401
10
- from dataclasses import dataclass
10
+ import dataclasses
11
11
  from . import base_t
12
12
 
13
13
  __all__: list[str] = [
@@ -16,7 +16,7 @@ __all__: list[str] = [
16
16
 
17
17
 
18
18
  # DO NOT MODIFY -- This file is generated by type_spec
19
- @dataclass(kw_only=True)
19
+ @dataclasses.dataclass(kw_only=True)
20
20
  class SimpleUser:
21
21
  user_id: base_t.ObjectId
22
22
  display_name: str
@@ -7,7 +7,7 @@ from __future__ import annotations
7
7
  import typing # noqa: F401
8
8
  import datetime # noqa: F401
9
9
  from decimal import Decimal # noqa: F401
10
- from dataclasses import dataclass
10
+ import dataclasses
11
11
  from . import base_t
12
12
 
13
13
  __all__: list[str] = [
@@ -17,14 +17,14 @@ __all__: list[str] = [
17
17
 
18
18
 
19
19
  # DO NOT MODIFY -- This file is generated by type_spec
20
- @dataclass(kw_only=True)
20
+ @dataclasses.dataclass(kw_only=True)
21
21
  class SimpleWorkflowStep:
22
22
  workflow_step_id: base_t.ObjectId
23
23
  name: typing.Optional[str]
24
24
 
25
25
 
26
26
  # DO NOT MODIFY -- This file is generated by type_spec
27
- @dataclass(kw_only=True)
27
+ @dataclasses.dataclass(kw_only=True)
28
28
  class SimpleWorkflow:
29
29
  workflow_id: base_t.ObjectId
30
30
  name: str
@@ -1,89 +0,0 @@
1
- # TODO: move to type spec
2
-
3
-
4
- from dataclasses import dataclass
5
- from enum import StrEnum
6
- from typing import Literal
7
-
8
-
9
- class JobDefinitionType(StrEnum):
10
- CRON = "cron"
11
- # also imagine other job types like webhook-triggered or sftp-triggered,
12
- # manual, etc
13
-
14
-
15
- class JobExecutorType(StrEnum):
16
- SCRIPT = "script"
17
- # also imagine builtin executors like 'sftp_sync'
18
-
19
-
20
- class AuthRetrievalType(StrEnum):
21
- ENV = "env"
22
- # also imagine secrets manager, keyvault, etc
23
-
24
-
25
- @dataclass
26
- class JobExecutorBase:
27
- type: JobExecutorType
28
-
29
-
30
- @dataclass
31
- class JobExecutorScript(JobExecutorBase):
32
- type: Literal[JobExecutorType.SCRIPT]
33
- import_path: str
34
-
35
-
36
- JobExecutor = JobExecutorScript
37
-
38
-
39
- @dataclass
40
- class JobDefinitionBase:
41
- id: str
42
- name: str
43
-
44
-
45
- @dataclass
46
- class CronJobDefinition(JobDefinitionBase):
47
- type: Literal[JobDefinitionType.CRON]
48
- cron_spec: str
49
- # Here we assert that the executor has to be a script, but we could add
50
- # other builtin executor types that cron jobs can support later
51
- executor: JobExecutorScript
52
-
53
-
54
- JobDefinition = CronJobDefinition
55
-
56
-
57
- @dataclass
58
- class AuthRetrievalBase:
59
- type: AuthRetrievalType
60
-
61
-
62
- @dataclass
63
- class AuthRetrievalEnv:
64
- # We don't really need any extra info here, we can enforce that the auth
65
- # keys are named like UNC_PROFILE_{profile name}_API_SECRET_KEY. For
66
- # supporting pulling secrets from secrets manager etc it will be nice to
67
- # use dataclass properties to get the secret name, region etc.
68
- type: Literal[AuthRetrievalType.ENV]
69
-
70
-
71
- AuthRetrieval = AuthRetrievalEnv
72
-
73
-
74
- @dataclass
75
- class ProfileDefinition:
76
- # profile name (expected to be something like customer_name) will be
77
- # obtained from the folder name instead of specified here. Forces jobs to
78
- # be organized nicely in folders that separate their identities.
79
- auth_retrieval: AuthRetrieval
80
- base_url: str
81
- jobs: list[JobDefinition]
82
-
83
-
84
- @dataclass
85
- class ProfileMetadata:
86
- # supplied by inspecting the folder name that the profile is in
87
- name: str
88
- base_url: str
89
- auth_retrieval: AuthRetrieval