UncountablePythonSDK 0.0.182__py3-none-any.whl → 0.0.184__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.
Files changed (28) hide show
  1. docs/requirements.txt +1 -1
  2. examples/integration-server/pyproject.toml +1 -1
  3. pkgs/filesystem_utils/_blob_session.py +52 -12
  4. pkgs/filesystem_utils/_file_share_session.py +43 -0
  5. pkgs/filesystem_utils/_s3_session.py +53 -7
  6. pkgs/filesystem_utils/filesystem_session.py +11 -0
  7. pkgs/type_spec/actions_registry/__main__.py +1 -0
  8. pkgs/type_spec/actions_registry/emit_python.py +2 -0
  9. pkgs/type_spec/actions_registry/emit_typescript.py +4 -0
  10. pkgs/type_spec/builder.py +6 -0
  11. pkgs/type_spec/emit_python.py +34 -6
  12. uncountable/core/environment.py +0 -4
  13. uncountable/integration/webhook_server/entrypoint.py +0 -2
  14. uncountable/types/api/recipes/set_recipe_inputs.py +1 -1
  15. uncountable/types/client_base.py +1 -1
  16. uncountable/types/entity_t.py +13 -1
  17. uncountable/types/uploader.py +2 -0
  18. uncountable/types/uploader_t.py +26 -1
  19. {uncountablepythonsdk-0.0.182.dist-info → uncountablepythonsdk-0.0.184.dist-info}/METADATA +1 -1
  20. {uncountablepythonsdk-0.0.182.dist-info → uncountablepythonsdk-0.0.184.dist-info}/RECORD +22 -28
  21. uncountable/integration/webhook_server/admin_auth.py +0 -38
  22. uncountable/integration/webhook_server/admin_routes/__init__.py +0 -3
  23. uncountable/integration/webhook_server/admin_routes/_boundary.py +0 -39
  24. uncountable/integration/webhook_server/admin_routes/health.py +0 -30
  25. uncountable/integration/webhook_server/admin_routes/jobs.py +0 -147
  26. uncountable/integration/webhook_server/admin_routes/register.py +0 -13
  27. {uncountablepythonsdk-0.0.182.dist-info → uncountablepythonsdk-0.0.184.dist-info}/WHEEL +0 -0
  28. {uncountablepythonsdk-0.0.182.dist-info → uncountablepythonsdk-0.0.184.dist-info}/top_level.txt +0 -0
docs/requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  furo==2025.12.19
2
2
  myst-parser==5.1.0
3
- sphinx-autoapi==3.8.0
3
+ sphinx-autoapi==3.8.1
4
4
  sphinx-copybutton==0.5.2
5
5
  Sphinx==9.1.0
6
6
  sphinx_design==0.7.0
@@ -13,7 +13,7 @@ dependencies = [
13
13
  "types-openpyxl == 3.*",
14
14
  "types-pytz ==2026.*",
15
15
  "types-requests == 2.*",
16
- "types-simplejson == 3.*",
16
+ "types-simplejson ==4.*",
17
17
  "pandas-stubs",
18
18
  "xlrd == 2.*",
19
19
  "msgspec ==0.21.*",
@@ -2,7 +2,7 @@ from io import BytesIO
2
2
  from typing import Self
3
3
 
4
4
  from azure.core.credentials import AzureSasCredential
5
- from azure.storage.blob import BlobServiceClient, ContainerClient
5
+ from azure.storage.blob import BlobPrefix, BlobServiceClient, ContainerClient
6
6
 
7
7
  from pkgs.filesystem_utils.file_type_utils import (
8
8
  FileObjectData,
@@ -78,6 +78,24 @@ class BlobSession(FileSystemSession):
78
78
 
79
79
  return filesystem_file_references
80
80
 
81
+ def list_directories(self, dir_path: FileSystemObject) -> list[FileSystemObject]:
82
+ if not isinstance(dir_path, FileSystemFileReference):
83
+ raise IncompatibleFileReferenceError()
84
+
85
+ assert self.service_client is not None and self.container_client is not None, (
86
+ "call to list_directories on uninitialized blob session"
87
+ )
88
+
89
+ prefix = _add_slash(dir_path.filepath)
90
+ directories: list[FileSystemObject] = []
91
+ for item in self.container_client.walk_blobs(
92
+ name_starts_with=prefix, delimiter="/"
93
+ ):
94
+ if isinstance(item, BlobPrefix):
95
+ directories.append(FileSystemFileReference(item.name.rstrip("/")))
96
+
97
+ return directories
98
+
81
99
  def download_files(
82
100
  self,
83
101
  filepaths: list[FileSystemObject],
@@ -108,6 +126,22 @@ class BlobSession(FileSystemSession):
108
126
 
109
127
  return downloaded_files
110
128
 
129
+ def _move_blob(self, src_name: str, dest_name: str) -> None:
130
+ assert self.container_client is not None, (
131
+ "call to _move_blob on uninitialized blob session"
132
+ )
133
+ source_blob_client = self.container_client.get_blob_client(src_name)
134
+ dest_blob_client = self.container_client.get_blob_client(dest_name)
135
+
136
+ source_url = (
137
+ f"{source_blob_client.url}?{self.config.credential.signature}"
138
+ if isinstance(self.config.credential, AzureSasCredential)
139
+ else source_blob_client.url
140
+ )
141
+
142
+ dest_blob_client.start_copy_from_url(source_url)
143
+ source_blob_client.delete_blob()
144
+
111
145
  def move_files(self, file_mappings: list[FileTransfer]) -> None:
112
146
  assert self.service_client is not None and self.container_client is not None, (
113
147
  "call to move_files on uninitialized blob session"
@@ -119,19 +153,25 @@ class BlobSession(FileSystemSession):
119
153
  ):
120
154
  raise IncompatibleFileReferenceError()
121
155
 
122
- source_blob_client = self.container_client.get_blob_client(
123
- src_file.filepath
124
- )
125
- dest_blob_client = self.container_client.get_blob_client(dest_file.filepath)
156
+ self._move_blob(src_file.filepath, dest_file.filepath)
126
157
 
127
- source_url = (
128
- f"{source_blob_client.url}?{self.config.credential.signature}"
129
- if isinstance(self.config.credential, AzureSasCredential)
130
- else source_blob_client.url
131
- )
158
+ def move_directory(
159
+ self, src_dir: FileSystemObject, dest_dir: FileSystemObject
160
+ ) -> None:
161
+ if not isinstance(src_dir, FileSystemFileReference) or not isinstance(
162
+ dest_dir, FileSystemFileReference
163
+ ):
164
+ raise IncompatibleFileReferenceError()
165
+
166
+ assert self.service_client is not None and self.container_client is not None, (
167
+ "call to move_directory on uninitialized blob session"
168
+ )
132
169
 
133
- dest_blob_client.start_copy_from_url(source_url)
134
- source_blob_client.delete_blob()
170
+ src_prefix = _add_slash(src_dir.filepath)
171
+ dest_prefix = _add_slash(dest_dir.filepath)
172
+ for blob in self.container_client.list_blobs(name_starts_with=src_prefix):
173
+ dest_name = dest_prefix + blob.name[len(src_prefix) :]
174
+ self._move_blob(blob.name, dest_name)
135
175
 
136
176
  def delete_files(self, filepaths: list[FileSystemObject]) -> None:
137
177
  assert self.service_client is not None and self.container_client is not None, (
@@ -79,6 +79,49 @@ class FileShareSession(FileSystemSession):
79
79
  dir_client, recursive=recursive, valid_extensions=valid_extensions
80
80
  )
81
81
 
82
+ def list_directories(self, dir_path: FileSystemObject) -> list[FileSystemObject]:
83
+ if not isinstance(dir_path, FileSystemFileReference):
84
+ raise IncompatibleFileReferenceError()
85
+ assert self._share_client is not None, (
86
+ "call to list_directories on uninitialized file share session"
87
+ )
88
+ dir_client = self._share_client.get_directory_client(dir_path.filepath)
89
+ directories: list[FileSystemObject] = []
90
+ for item in dir_client.list_directories_and_files():
91
+ if item["is_directory"]:
92
+ item_path = f"{dir_client.directory_path}/{item['name']}".lstrip("/")
93
+ directories.append(FileSystemFileReference(filepath=item_path))
94
+ return directories
95
+
96
+ def create_directory(self, dir_path: FileSystemObject) -> None:
97
+ if not isinstance(dir_path, FileSystemFileReference):
98
+ raise IncompatibleFileReferenceError()
99
+ assert self._share_client is not None, (
100
+ "call to create_directory on uninitialized file share session"
101
+ )
102
+ current = ""
103
+ for segment in dir_path.filepath.strip("/").split("/"):
104
+ if not segment:
105
+ continue
106
+ current = f"{current}/{segment}".lstrip("/")
107
+ dir_client = self._share_client.get_directory_client(current)
108
+ if not dir_client.exists():
109
+ dir_client.create_directory()
110
+
111
+ def move_directory(
112
+ self, src_dir: FileSystemObject, dest_dir: FileSystemObject
113
+ ) -> None:
114
+ if not isinstance(src_dir, FileSystemFileReference) or not isinstance(
115
+ dest_dir, FileSystemFileReference
116
+ ):
117
+ raise IncompatibleFileReferenceError()
118
+ assert self._share_client is not None, (
119
+ "call to move_directory on uninitialized file share session"
120
+ )
121
+ self._share_client.get_directory_client(src_dir.filepath).rename_directory(
122
+ dest_dir.filepath
123
+ )
124
+
82
125
  def download_files(self, filepaths: list[FileSystemObject]) -> list[FileObjectData]:
83
126
  assert self._share_client is not None, (
84
127
  "call to download_files on uninitialized file share session"
@@ -86,6 +86,28 @@ class S3Session(FileSystemSession):
86
86
 
87
87
  return filesystem_references
88
88
 
89
+ def list_directories(self, dir_path: FileSystemObject) -> list[FileSystemObject]:
90
+ if not isinstance(dir_path, FileSystemFileReference):
91
+ raise IncompatibleFileReferenceError()
92
+
93
+ assert self.bucket is not None, (
94
+ "call to list_directories on uninitialized s3 session"
95
+ )
96
+
97
+ prefix = _add_slash(dir_path.filepath)
98
+ paginator = self.bucket.meta.client.get_paginator("list_objects_v2")
99
+
100
+ directories: list[FileSystemObject] = []
101
+ for page in paginator.paginate(
102
+ Bucket=self.bucket.name, Prefix=prefix, Delimiter="/"
103
+ ):
104
+ for common_prefix in page.get("CommonPrefixes", []):
105
+ directories.append(
106
+ FileSystemFileReference(common_prefix["Prefix"].rstrip("/"))
107
+ )
108
+
109
+ return directories
110
+
89
111
  def download_files(
90
112
  self,
91
113
  filepaths: list[FileSystemObject],
@@ -115,6 +137,18 @@ class S3Session(FileSystemSession):
115
137
 
116
138
  return downloaded_files
117
139
 
140
+ def _move_object(self, src_key: str, dest_key: str) -> None:
141
+ assert self.bucket is not None, (
142
+ "call to _move_object on uninitialized s3 session"
143
+ )
144
+ self.bucket.Object(dest_key).copy_from(
145
+ CopySource={
146
+ "Bucket": self.bucket.name,
147
+ "Key": src_key,
148
+ }
149
+ )
150
+ self.bucket.Object(src_key).delete()
151
+
118
152
  def move_files(self, file_mappings: list[FileTransfer]) -> None:
119
153
  assert self.bucket is not None, "call to move_files on uninitialized s3 session"
120
154
 
@@ -123,10 +157,22 @@ class S3Session(FileSystemSession):
123
157
  dest_file, FileSystemFileReference
124
158
  ):
125
159
  raise IncompatibleFileReferenceError()
126
- self.bucket.Object(dest_file.filepath).copy_from(
127
- CopySource={
128
- "Bucket": self.bucket.name,
129
- "Key": src_file.filepath,
130
- }
131
- )
132
- self.bucket.Object(src_file.filepath).delete()
160
+ self._move_object(src_file.filepath, dest_file.filepath)
161
+
162
+ def move_directory(
163
+ self, src_dir: FileSystemObject, dest_dir: FileSystemObject
164
+ ) -> None:
165
+ if not isinstance(src_dir, FileSystemFileReference) or not isinstance(
166
+ dest_dir, FileSystemFileReference
167
+ ):
168
+ raise IncompatibleFileReferenceError()
169
+
170
+ assert self.bucket is not None, (
171
+ "call to move_directory on uninitialized s3 session"
172
+ )
173
+
174
+ src_prefix = _add_slash(src_dir.filepath)
175
+ dest_prefix = _add_slash(dest_dir.filepath)
176
+ for obj in self.bucket.objects.filter(Prefix=src_prefix):
177
+ dest_key = dest_prefix + obj.key[len(src_prefix) :]
178
+ self._move_object(obj.key, dest_key)
@@ -32,6 +32,17 @@ class FileSystemSession(ABC):
32
32
  def delete_files(self, filepaths: list[FileSystemObject]) -> None:
33
33
  raise NotImplementedError
34
34
 
35
+ def list_directories(self, dir_path: FileSystemObject) -> list[FileSystemObject]:
36
+ raise NotImplementedError
37
+
38
+ def create_directory(self, dir_path: FileSystemObject) -> None:
39
+ raise NotImplementedError
40
+
41
+ def move_directory(
42
+ self, src_dir: FileSystemObject, dest_dir: FileSystemObject
43
+ ) -> None:
44
+ raise NotImplementedError
45
+
35
46
  @abstractmethod
36
47
  def __enter__(self) -> "FileSystemSession": ...
37
48
 
@@ -82,6 +82,7 @@ def main() -> None:
82
82
  short_description=definition.short_description,
83
83
  description=definition.description,
84
84
  icon=definition.icon,
85
+ action=definition.action,
85
86
  ref_name=ref_name,
86
87
  module=actions_registry_t.ActionsRegistryModule(
87
88
  ts_name(module_str, name_case=builder.NameCase.convert)
@@ -51,6 +51,8 @@ def _emit_action_definition(
51
51
  out.write(f"{sub_indent}description={_py_str(action.description)},\n")
52
52
  if action.icon is not None:
53
53
  out.write(f"{sub_indent}icon={_py_str(action.icon)},\n")
54
+ if action.action is not None:
55
+ out.write(f"{sub_indent}action={_py_str(action.action)},\n")
54
56
  out.write(f"{sub_indent}ref_name={_py_str(action.ref_name)},\n")
55
57
  out.write(
56
58
  f"{sub_indent}module=actions_registry_t.ActionsRegistryModule.{action.module.name},\n"
@@ -130,6 +130,10 @@ def _emit_action_definition(
130
130
  out.write(
131
131
  f"{sub_indent}icon: {encode_common_string(action_definition.icon)},\n"
132
132
  )
133
+ if action_definition.action is not None:
134
+ out.write(
135
+ f"{sub_indent}action: {encode_common_string(action_definition.action)},\n"
136
+ )
133
137
  out.write(
134
138
  f"{sub_indent}shortDescription: {encode_common_string(action_definition.short_description)},\n"
135
139
  )
pkgs/type_spec/builder.py CHANGED
@@ -1106,6 +1106,7 @@ class SpecEndpoint:
1106
1106
  desc: str | None = None
1107
1107
  account_type: str | None
1108
1108
  route_group: str | None
1109
+ allow_non_materials_path: bool = False
1109
1110
 
1110
1111
  # function, path details per api endpoint
1111
1112
  path_per_api_endpoint: dict[str, EndpointSpecificPath]
@@ -1135,6 +1136,7 @@ class SpecEndpoint:
1135
1136
  "has_attachment",
1136
1137
  "account_type",
1137
1138
  "route_group",
1139
+ "allow_non_materials_path",
1138
1140
  ]
1139
1141
  + list(builder.api_endpoints.keys()),
1140
1142
  )
@@ -1188,6 +1190,10 @@ class SpecEndpoint:
1188
1190
  assert isinstance(suppress_ts, bool)
1189
1191
  self.suppress_ts = suppress_ts
1190
1192
 
1193
+ allow_non_materials_path = data.get("allow_non_materials_path", False)
1194
+ assert isinstance(allow_non_materials_path, bool)
1195
+ self.allow_non_materials_path = allow_non_materials_path
1196
+
1191
1197
  self.result_type = ResultType(data.get("result_type", ResultType.json.value))
1192
1198
  self.has_attachment = data.get("has_attachment", False)
1193
1199
  self.desc = data.get("desc")
@@ -1166,13 +1166,25 @@ def _emit_routes(*, builder: builder.SpecBuilder, config: PythonConfig) -> None:
1166
1166
  continue
1167
1167
 
1168
1168
  endpoints.append(endpoint)
1169
+
1170
+ has_route_opts = any(
1171
+ endpoint.allow_non_materials_path for endpoint in endpoints
1172
+ )
1173
+ route_opts_import = ["RouteOpts"] if has_route_opts else []
1174
+ static_route_imports = ", ".join(
1175
+ sorted(["StaticRouteType", *route_opts_import])
1176
+ )
1177
+ dynamic_route_imports = ", ".join(
1178
+ sorted(["DynamicRouteType", *route_opts_import])
1179
+ )
1180
+
1169
1181
  static_out = io.StringIO()
1170
1182
  static_out.write(
1171
1183
  f"""{MODIFY_NOTICE}{LINT_HEADER}{ROUTE_NOTICE}
1172
1184
 
1173
1185
  # Static routes for use locally and to ensure linting/mypy finds all modules
1174
1186
 
1175
- from main.site.framework.types import StaticRouteType
1187
+ from main.site.framework.types import {static_route_imports}
1176
1188
  """
1177
1189
  )
1178
1190
 
@@ -1218,7 +1230,7 @@ ROUTES: list[StaticRouteType] = [
1218
1230
 
1219
1231
  # Dynamic loaded routes to provide faster startup times
1220
1232
 
1221
- from main.site.framework.types import DynamicRouteType
1233
+ from main.site.framework.types import {dynamic_route_imports}
1222
1234
 
1223
1235
  ROUTE_PREFIX = "/{last_endpoint.path_per_api_endpoint[endpoint_root].path_root}"
1224
1236
 
@@ -1226,19 +1238,35 @@ ROUTES: list[DynamicRouteType] = [
1226
1238
  """
1227
1239
  )
1228
1240
 
1241
+ route_opts_out = io.StringIO()
1229
1242
  for endpoint in sorted_endpoints:
1230
1243
  endpoint_function_path = endpoint.path_per_api_endpoint[endpoint_root]
1244
+ route = f"{endpoint_function_path.path_dirname}/{endpoint_function_path.path_basename}"
1231
1245
  dynamic_out.write(
1232
- f'{INDENT}("{endpoint_function_path.path_dirname}/{endpoint_function_path.path_basename}", "{endpoint_function_path.function}", ["{endpoint.method.upper()}"]),\n'
1246
+ f'{INDENT}("{route}", "{endpoint_function_path.function}", ["{endpoint.method.upper()}"]),\n'
1233
1247
  )
1234
1248
 
1235
1249
  assert endpoint_function_path.function
1236
1250
  static_out.write(
1237
- f'{INDENT}("{endpoint_function_path.path_dirname}/{endpoint_function_path.path_basename}", {endpoint_function_path.function}, ["{endpoint.method.upper()}"]),\n'
1251
+ f'{INDENT}("{route}", {endpoint_function_path.function}, ["{endpoint.method.upper()}"]),\n'
1238
1252
  )
1239
1253
 
1240
- dynamic_out.write(f"{MODIFY_NOTICE}]\n")
1241
- static_out.write(f"{MODIFY_NOTICE}]\n")
1254
+ if endpoint.allow_non_materials_path:
1255
+ route_opts_out.write(
1256
+ f'{INDENT}"{route}": RouteOpts(allow_non_materials_path=True),\n'
1257
+ )
1258
+
1259
+ routes_close = f"{MODIFY_NOTICE}]\n"
1260
+ dynamic_out.write(routes_close)
1261
+ static_out.write(routes_close)
1262
+
1263
+ if has_route_opts:
1264
+ route_opts_emit = f"""
1265
+ ROUTE_OPTS: dict[str, RouteOpts] = {{
1266
+ {route_opts_out.getvalue()}{MODIFY_NOTICE}}}
1267
+ """
1268
+ dynamic_out.write(route_opts_emit)
1269
+ static_out.write(route_opts_emit)
1242
1270
 
1243
1271
  util.rewrite_file(f"{output}/routes_static.py", static_out.getvalue())
1244
1272
  util.rewrite_file(f"{output}/routes_dynamic.py", dynamic_out.getvalue())
@@ -26,10 +26,6 @@ def get_local_admin_server_port() -> int:
26
26
  return int(os.environ.get("UNC_ADMIN_SERVER_PORT", "50051"))
27
27
 
28
28
 
29
- def get_integration_admin_token() -> str | None:
30
- return os.environ.get("UNC_INTEGRATION_ADMIN_TOKEN")
31
-
32
-
33
29
  def get_otel_enabled() -> bool:
34
30
  return os.environ.get("UNC_OTEL_ENABLED") == "true"
35
31
 
@@ -12,7 +12,6 @@ from uncountable.integration.http_server import GenericHttpRequest, HttpExceptio
12
12
  from uncountable.integration.job import CustomHttpJob, WebhookJob
13
13
  from uncountable.integration.scan_profiles import load_profiles
14
14
  from uncountable.integration.telemetry import Logger
15
- from uncountable.integration.webhook_server.admin_routes import register_admin_routes
16
15
  from uncountable.types import job_definition_t
17
16
 
18
17
  app = flask.Flask(__name__)
@@ -99,7 +98,6 @@ def register_route(
99
98
 
100
99
  def main() -> None:
101
100
  app.add_url_rule("/health", "health", lambda: ("OK", 200))
102
- register_admin_routes(app)
103
101
 
104
102
  profiles = load_profiles()
105
103
  for profile_metadata in profiles:
@@ -21,7 +21,7 @@ __all__: list[str] = [
21
21
 
22
22
  ENDPOINT_METHOD = "POST"
23
23
  ENDPOINT_PATH = "api/external/recipes/external_set_recipe_inputs"
24
- ENDPOINT_DESCRIPTION = "Sets input values for experiments. Supports numeric, text, and categorical types. Validates that the recipe step belongs to the correct recipe. Supports setting actual values, associating lots (creating them if needed), and removing inputs. Writes all values to the first workflow step when no step is specified. Fails if both a numeric and string value are provided."
24
+ ENDPOINT_DESCRIPTION = "Sets input values for experiments. Supports numeric, text, and categorical types. Validates that the recipe step belongs to the correct recipe. Each entry edits one input on one recipe with a single operation: set the value (the actual value when set_actual_value is true, otherwise the set value), associate a lot (lot_recipe_id, created if the recipe is not already a lot), or remove the input (remove). A lot association targets the set value; combining it with set_actual_value fails. Writes all values to the first workflow step when no step is specified. Fails if both a numeric and string value are provided."
25
25
 
26
26
 
27
27
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -2177,7 +2177,7 @@ class ClientMethods(ABC):
2177
2177
  input_data: list[set_recipe_inputs_t.RecipeInputValue],
2178
2178
  _request_options: client_config_t.RequestOptions | None = None,
2179
2179
  ) -> set_recipe_inputs_t.Data:
2180
- """Sets input values for experiments. Supports numeric, text, and categorical types. Validates that the recipe step belongs to the correct recipe. Supports setting actual values, associating lots (creating them if needed), and removing inputs. Writes all values to the first workflow step when no step is specified. Fails if both a numeric and string value are provided.
2180
+ """Sets input values for experiments. Supports numeric, text, and categorical types. Validates that the recipe step belongs to the correct recipe. Each entry edits one input on one recipe with a single operation: set the value (the actual value when set_actual_value is true, otherwise the set value), associate a lot (lot_recipe_id, created if the recipe is not already a lot), or remove the input (remove). A lot association targets the set value; combining it with set_actual_value fails. Writes all values to the first workflow step when no step is specified. Fails if both a numeric and string value are provided.
2181
2181
 
2182
2182
  :param input_data: The inputs to set. Must be at most 100 entries long
2183
2183
  """
@@ -27,6 +27,7 @@ __all__: list[str] = [
27
27
  # DO NOT MODIFY -- This file is generated by type_spec
28
28
  @serial_string_enum(
29
29
  labels={
30
+ "agent_memory": "Agent Memory",
30
31
  "aggregated_data_view": "Aggregated Data View",
31
32
  "analytical_method": "Analytical Method",
32
33
  "analytical_method_category": "Analytical Method Category",
@@ -35,6 +36,8 @@ __all__: list[str] = [
35
36
  "approval": "Approval",
36
37
  "async_job": "Async Job",
37
38
  "barcode": "Barcode",
39
+ "cad_document": "CAD Document",
40
+ "cad_relationship": "CAD Relationship",
38
41
  "calculation": "Calculation",
39
42
  "calendar": "Calendar",
40
43
  "calendar_event": "Calendar Event",
@@ -57,6 +60,7 @@ __all__: list[str] = [
57
60
  "credit_balance": "Credit Balance",
58
61
  "curve_settings": "Curve Settings",
59
62
  "custom_entity": "Custom Entity",
63
+ "data_pipeline": "Data Pipeline",
60
64
  "dataset_binding": "Dataset Binding",
61
65
  "default_permissions_new_project": "Default Permissions New Project",
62
66
  "document": "Document",
@@ -90,6 +94,7 @@ __all__: list[str] = [
90
94
  "external_ai_model": "External AI Model",
91
95
  "external_ai_session": "External AI Session",
92
96
  "external_ai_usage": "External AI Usage",
97
+ "external_ai_plugin": "External AI Plugin",
93
98
  "external_oauth_provider": "External OAuth Provider",
94
99
  "experiment_group": "Experiment Group",
95
100
  "experiment_group_member": "Experiment Group Member",
@@ -206,6 +211,7 @@ __all__: list[str] = [
206
211
  "regional_entity_group": "Regional Entity Group",
207
212
  "regulation": "Regulation",
208
213
  "regulation_cas": "Regulation CAS",
214
+ "regulation_product_category": "Regulation Product Category",
209
215
  "metadata_value": "Metadata Value",
210
216
  "report_definition": "Report Definition",
211
217
  "reusable_field_condition": "Reusable Field Condition",
@@ -297,6 +303,7 @@ __all__: list[str] = [
297
303
  },
298
304
  )
299
305
  class EntityType(StrEnum):
306
+ AGENT_MEMORY = "agent_memory"
300
307
  AGGREGATED_DATA_VIEW = "aggregated_data_view"
301
308
  ANALYTICAL_METHOD = "analytical_method"
302
309
  ANALYTICAL_METHOD_CATEGORY = "analytical_method_category"
@@ -305,6 +312,8 @@ class EntityType(StrEnum):
305
312
  APPROVAL = "approval"
306
313
  ASYNC_JOB = "async_job"
307
314
  BARCODE = "barcode"
315
+ CAD_DOCUMENT = "cad_document"
316
+ CAD_RELATIONSHIP = "cad_relationship"
308
317
  CALCULATION = "calculation"
309
318
  CALENDAR = "calendar"
310
319
  CALENDAR_EVENT = "calendar_event"
@@ -327,6 +336,7 @@ class EntityType(StrEnum):
327
336
  CREDIT_BALANCE = "credit_balance"
328
337
  CURVE_SETTINGS = "curve_settings"
329
338
  CUSTOM_ENTITY = "custom_entity"
339
+ DATA_PIPELINE = "data_pipeline"
330
340
  DATASET_BINDING = "dataset_binding"
331
341
  DEFAULT_PERMISSIONS_NEW_PROJECT = "default_permissions_new_project"
332
342
  DOCUMENT = "document"
@@ -360,6 +370,7 @@ class EntityType(StrEnum):
360
370
  EXTERNAL_AI_MODEL = "external_ai_model"
361
371
  EXTERNAL_AI_SESSION = "external_ai_session"
362
372
  EXTERNAL_AI_USAGE = "external_ai_usage"
373
+ EXTERNAL_AI_PLUGIN = "external_ai_plugin"
363
374
  EXTERNAL_OAUTH_PROVIDER = "external_oauth_provider"
364
375
  EXPERIMENT_GROUP = "experiment_group"
365
376
  EXPERIMENT_GROUP_MEMBER = "experiment_group_member"
@@ -476,6 +487,7 @@ class EntityType(StrEnum):
476
487
  REGIONAL_ENTITY_GROUP = "regional_entity_group"
477
488
  REGULATION = "regulation"
478
489
  REGULATION_CAS = "regulation_cas"
490
+ REGULATION_PRODUCT_CATEGORY = "regulation_product_category"
479
491
  METADATA_VALUE = "metadata_value"
480
492
  REPORT_DEFINITION = "report_definition"
481
493
  REUSABLE_FIELD_CONDITION = "reusable_field_condition"
@@ -568,7 +580,7 @@ class EntityType(StrEnum):
568
580
 
569
581
  # DO NOT MODIFY -- This file is generated by type_spec
570
582
  LimitedEntityType = typing.Annotated[
571
- typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INGREDIENT_ATTRIBUTE] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.NOTEBOOK] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB] | typing.Literal[EntityType.CONSTRAINT] | typing.Literal[EntityType.CONSTRAINT_SET] | typing.Literal[EntityType.INGREDIENT_CATEGORY_ALL] | typing.Literal[EntityType.TIME_SERIES_SEGMENT] | typing.Literal[EntityType.EQUIPMENT_MAINTENANCE] | typing.Literal[EntityType.MAINTENANCE_SCHEDULE] | typing.Literal[EntityType.CONDITION_PARAMETER_RULE] | typing.Literal[EntityType.INGREDIENT] | typing.Literal[EntityType.TIMESHEET_ENTRY] | typing.Literal[EntityType.SAVE] | typing.Literal[EntityType.RECIPE_CHECK] | typing.Literal[EntityType.EXPERIMENT_GROUP_MEMBER] | typing.Literal[EntityType.CALENDAR_EVENT],
583
+ typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INGREDIENT_ATTRIBUTE] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.NOTEBOOK] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB] | typing.Literal[EntityType.CONSTRAINT] | typing.Literal[EntityType.CONSTRAINT_SET] | typing.Literal[EntityType.INGREDIENT_CATEGORY_ALL] | typing.Literal[EntityType.TIME_SERIES_SEGMENT] | typing.Literal[EntityType.EQUIPMENT_MAINTENANCE] | typing.Literal[EntityType.MAINTENANCE_SCHEDULE] | typing.Literal[EntityType.CONDITION_PARAMETER_RULE] | typing.Literal[EntityType.INGREDIENT] | typing.Literal[EntityType.TIMESHEET_ENTRY] | typing.Literal[EntityType.SAVE] | typing.Literal[EntityType.RECIPE_CHECK] | typing.Literal[EntityType.EXPERIMENT_GROUP_MEMBER] | typing.Literal[EntityType.INPUT_GROUP] | typing.Literal[EntityType.INPUT_GROUP_MEMBER] | typing.Literal[EntityType.CALENDAR_EVENT],
572
584
  serial_alias_annotation(
573
585
  named_type_path="sdk.entity.LimitedEntityType",
574
586
  ),
@@ -8,8 +8,10 @@ from .uploader_t import ChannelType as ChannelType
8
8
  from .uploader_t import StructureElementType as StructureElementType
9
9
  from .uploader_t import StructureElementBase as StructureElementBase
10
10
  from .uploader_t import DecimalValue as DecimalValue
11
+ from .uploader_t import IdValue as IdValue
11
12
  from .uploader_t import StringValue as StringValue
12
13
  from .uploader_t import BaseData as BaseData
14
+ from .uploader_t import FileHeaderData as FileHeaderData
13
15
  from .uploader_t import NumericHeaderData as NumericHeaderData
14
16
  from .uploader_t import TextHeaderData as TextHeaderData
15
17
  from .uploader_t import HeaderValue as HeaderValue
@@ -10,6 +10,7 @@ from enum import StrEnum
10
10
  import dataclasses
11
11
  from pkgs.serialization import serial_class
12
12
  from pkgs.serialization import serial_union_annotation
13
+ from . import base_t
13
14
 
14
15
  __all__: list[str] = [
15
16
  "BaseData",
@@ -17,9 +18,11 @@ __all__: list[str] = [
17
18
  "ChannelType",
18
19
  "DataChannel",
19
20
  "DecimalValue",
21
+ "FileHeaderData",
20
22
  "HeaderEntry",
21
23
  "HeaderType",
22
24
  "HeaderValue",
25
+ "IdValue",
23
26
  "NumericChannelData",
24
27
  "NumericHeaderData",
25
28
  "ParsedFileData",
@@ -35,6 +38,7 @@ __all__: list[str] = [
35
38
 
36
39
  # DO NOT MODIFY -- This file is generated by type_spec
37
40
  class HeaderType(StrEnum):
41
+ FILE_HEADER = "file_header"
38
42
  NUMERIC_HEADER = "numeric_header"
39
43
  TEXT_HEADER = "text_header"
40
44
 
@@ -71,6 +75,15 @@ class DecimalValue:
71
75
  value: Decimal
72
76
 
73
77
 
78
+ # DO NOT MODIFY -- This file is generated by type_spec
79
+ @serial_class(
80
+ named_type_path="sdk.uploader.IdValue",
81
+ )
82
+ @dataclasses.dataclass(slots=True, kw_only=True)
83
+ class IdValue:
84
+ value: base_t.ObjectId
85
+
86
+
74
87
  # DO NOT MODIFY -- This file is generated by type_spec
75
88
  @serial_class(
76
89
  named_type_path="sdk.uploader.StringValue",
@@ -90,6 +103,17 @@ class BaseData:
90
103
  type: str
91
104
 
92
105
 
106
+ # DO NOT MODIFY -- This file is generated by type_spec
107
+ @serial_class(
108
+ named_type_path="sdk.uploader.FileHeaderData",
109
+ parse_require={"type"},
110
+ )
111
+ @dataclasses.dataclass(slots=True, kw_only=True)
112
+ class FileHeaderData(BaseData):
113
+ type: typing.Literal[HeaderType.FILE_HEADER] = HeaderType.FILE_HEADER
114
+ data: IdValue | None
115
+
116
+
93
117
  # DO NOT MODIFY -- This file is generated by type_spec
94
118
  @serial_class(
95
119
  named_type_path="sdk.uploader.NumericHeaderData",
@@ -114,11 +138,12 @@ class TextHeaderData(BaseData):
114
138
 
115
139
  # DO NOT MODIFY -- This file is generated by type_spec
116
140
  HeaderValue = typing.Annotated[
117
- NumericHeaderData | TextHeaderData,
141
+ FileHeaderData | NumericHeaderData | TextHeaderData,
118
142
  serial_union_annotation(
119
143
  named_type_path="sdk.uploader.HeaderValue",
120
144
  discriminator="type",
121
145
  discriminator_map={
146
+ "file_header": FileHeaderData,
122
147
  "numeric_header": NumericHeaderData,
123
148
  "text_header": TextHeaderData,
124
149
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.182
3
+ Version: 0.0.184
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -3,7 +3,7 @@ docs/.gitignore,sha256=_ebkZUcwfvfnGEJ95rfj1lxoBNd6EE9ZvtOc7FsbfFE,7
3
3
  docs/conf.py,sha256=KivJNvQWboXqJ07NMgcYY5tsV6CoIfyTpZh8jdn_5Qk,4239
4
4
  docs/index.md,sha256=g4Yi5831fEkywYkkcFohYLkKzSI91SOZF7DxKsm9zgI,3193
5
5
  docs/justfile,sha256=WymCEQ6W2A8Ak79iUPmecmuaUNN2htb7STUrz5K7ELE,273
6
- docs/requirements.txt,sha256=8aqtVaNV4AlzUZ7nAM8kxOF1ccAcujhQ_ayU9Whksf8,172
6
+ docs/requirements.txt,sha256=_GyKrMFrmjp2hKhTLlhGdKqD7kXs_bomeY4yGt1oI7c,172
7
7
  docs/integration_examples/add_file_to_folder.md,sha256=ZCv8miP7ZlPjor-ZGDwy2oucyopqMPa3aXlmOEfbX10,1556
8
8
  docs/integration_examples/create_ingredient.md,sha256=ufzAzPyGaDr9rCBDMGQAE8xahsCMkVfG8VLs1pb3qr0,1549
9
9
  docs/integration_examples/create_output.md,sha256=aDn2TjzKgY-HnxnvgsZS578cvajmHpF1y2HKkHfdtd4,2104
@@ -33,7 +33,7 @@ examples/set_recipe_metadata_file.py,sha256=cRVXGz4UN4aqnNrNSzyBmikYHpe63lMIuzOp
33
33
  examples/set_recipe_output_file_sdk.py,sha256=Lz1amqppnWTX83z-C090wCJ4hcKmCD3kb-4v0uBRi0Y,782
34
34
  examples/stream_dataset_measurements.py,sha256=iLmDn7Yv-deeUsfDY9DhYckheoTfLhj5_ORjO0oLHng,5890
35
35
  examples/upload_files.py,sha256=qMaSvMSdTMPOOP55y1AwEurc0SOdZAMvEydlqJPsGpg,432
36
- examples/integration-server/pyproject.toml,sha256=ATAn8vGr9cRRKtceYjwQHParKwfzz_j46rIEEOq4SvE,11591
36
+ examples/integration-server/pyproject.toml,sha256=CxNt8vQ17Po7h4fOXT8jtbrFJosxBVTVY8kTuRyxtjY,11590
37
37
  examples/integration-server/jobs/materials_auto/concurrent_cron.py,sha256=xsK3H9ZEaniedC2nJUB0rqOcFI8y-ojfl_nLSJb9AMM,312
38
38
  examples/integration-server/jobs/materials_auto/example_cron.py,sha256=y1nAtGwbPJfIrfQsrHVmJLAHmQtCEHIy1g-0PjeXx04,735
39
39
  examples/integration-server/jobs/materials_auto/example_http.py,sha256=hA--iNztlTwLaEBzlmoRZ6-hRTUExUUqLV0-ipU7_mo,1560
@@ -57,15 +57,15 @@ pkgs/argument_parser/parser_inner.py,sha256=0zepgTqQm6yFp9WMlHJmWV3S9WsxzRiN_nBw
57
57
  pkgs/argument_parser/parser_options.py,sha256=NAwNZSIH8EjyfJXJSxbn4kYmF3K7D3HuOedlSjjsF28,1332
58
58
  pkgs/argument_parser/type_predicates.py,sha256=CkQexiseN05XDz4e34K3gIOlER5LG5Ke8u0UHK4gC04,1157
59
59
  pkgs/filesystem_utils/__init__.py,sha256=b8NblpFX4rwyRSY3d8GGJRk9x3ET5jpsxDz0M2VnGlw,2071
60
- pkgs/filesystem_utils/_blob_session.py,sha256=2xcelJlME7bCNmBiTMnwycGDkwo0UtYfbGQEkCj0Ndo,5183
61
- pkgs/filesystem_utils/_file_share_session.py,sha256=27QmvifiwMYQ25eRVKWdr3VZDdZmBtYXTF6lhPUcld4,5155
60
+ pkgs/filesystem_utils/_blob_session.py,sha256=pdRWflJAQux06ZZZLjbH1kic4djG8YBTiAN3fZ8nSVA,6870
61
+ pkgs/filesystem_utils/_file_share_session.py,sha256=GyC9w762CbnvpC0ooZumZnzqrIULYOkHN7UIz3I7jXc,7131
62
62
  pkgs/filesystem_utils/_gdrive_session.py,sha256=pxZNTR5t8gJFS-HwMCZiQ-ZwCJV_ij5PWiBf1BUy9DE,11122
63
63
  pkgs/filesystem_utils/_local_session.py,sha256=FXxLn7CqmYZZib3mCGg0BuItIGwlvOIsKEJcZHfJ_iw,2359
64
- pkgs/filesystem_utils/_s3_session.py,sha256=jmc3UdOog_4cpnRvoqJgkzSAgBGYjmoMN92GIgUX-zw,4523
64
+ pkgs/filesystem_utils/_s3_session.py,sha256=0MS1RXPA7wnoLKG8eDV_ONFS4f_rhA5Ey3yn65-JZ_g,6250
65
65
  pkgs/filesystem_utils/_sftp_connection.py,sha256=XeRNdfdXPjpRYiirp7GGsmQOQ4W4WMZihuDKFqy9nRE,4854
66
66
  pkgs/filesystem_utils/_sftp_session.py,sha256=62E2OWHWvtAcKjxq2g5L4cCWiXiOFwRoyQX9Hr6d3RU,4927
67
67
  pkgs/filesystem_utils/file_type_utils.py,sha256=Hf-NP1E8lKn9QAx9LH2a6Fc5jSXfmE8l0CMCtqvjyFA,2140
68
- pkgs/filesystem_utils/filesystem_session.py,sha256=BQ2Go8Mu9-GcnaWh2Pm4x7ugLVsres6XrOQ8RoiEpcE,1045
68
+ pkgs/filesystem_utils/filesystem_session.py,sha256=zOddRkBZC5tsTiwquySeKTkKM5yNwW3Q_jDq9U0XcuI,1411
69
69
  pkgs/serialization/__init__.py,sha256=HWzdZ5CtMnZ-svy08eiDn6K9P_IveCjkjQ3whxPoCs4,1093
70
70
  pkgs/serialization/annotation.py,sha256=JXP2caXNoj8h_Pvx_26iarPlsaPcIqe1qssTksJiKjM,3408
71
71
  pkgs/serialization/missing_sentry.py,sha256=VCXiYs7s5MkfG8kbmwDAswdq0fL4zFRj4B2uSQzmTos,819
@@ -86,14 +86,14 @@ pkgs/strenum_compat/__init__.py,sha256=Bq1kcPIQsXRiLUGWc63QGnVa5BlhvuFWpMMvdNcHy
86
86
  pkgs/strenum_compat/strenum_compat.py,sha256=uOUAgpYTjHs1MX8dG81jRlyTkt3KNbkV_25zp7xTX2s,36
87
87
  pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
88
88
  pkgs/type_spec/__main__.py,sha256=snBwPNvzU46Rqp4HlYb5Urv10Rs36gUbsPoFZfQcWRY,1162
89
- pkgs/type_spec/builder.py,sha256=yDtMWRd1EeHlcS9SqR1RKZ0ovuasmIgjpg0v4DvZ4mg,66086
89
+ pkgs/type_spec/builder.py,sha256=i8uMhsG7cJa5Dxn25RQyJk9pgwvOd1mc-bO0O49tYxA,66376
90
90
  pkgs/type_spec/builder_types.py,sha256=EFXvwd3DhuFcqMtG12U9RHNYXHxi_g6kY5AVPBo3fCg,253
91
91
  pkgs/type_spec/config.py,sha256=8SQkCRAKzrcycR-9Tjt6J4-kNalN8IvbE7zo1FMlrZc,7226
92
92
  pkgs/type_spec/cross_output_links.py,sha256=exmHrdr-Mrq6FyMXzWgmuKhE-uqo_rN5k_PcirQgrGU,3037
93
93
  pkgs/type_spec/emit_io_ts.py,sha256=sIdS5f_C79SiaSqVS4HtQ8SFxA87ehXkj9CrmrpjTzg,5862
94
94
  pkgs/type_spec/emit_open_api.py,sha256=C3PRRSQJpHUZkS4CeEMGywhbLYs_MD3t6u-DlVIe2WA,28638
95
95
  pkgs/type_spec/emit_open_api_util.py,sha256=bTmRvrGP82-eB75hwf9ySI7pDEC87FNQTF18VKEWSXY,2367
96
- pkgs/type_spec/emit_python.py,sha256=K9fH9wUw1h3y5Uxv4Xg2KFEMhDySuhDmV0v0xSPssHM,58681
96
+ pkgs/type_spec/emit_python.py,sha256=R66jEWVL0RcN15xDUvjNBe4YcT15hBfKyWU-k5ipbWo,59567
97
97
  pkgs/type_spec/emit_scss.py,sha256=6psmBAJyu7cvfQAIvIIMk2U6VFG_xeWy1Ea4afv0XyM,1497
98
98
  pkgs/type_spec/emit_typescript.py,sha256=Qu9f1Yv_wc449KHcBGO58hatbzvPvgMbZ11jferi3oY,11567
99
99
  pkgs/type_spec/emit_typescript_util.py,sha256=dRiOm38M4DR5NtvJyaEoGXE8Zzrfnae6yuDC76OzCeU,14915
@@ -103,9 +103,9 @@ pkgs/type_spec/open_api_util.py,sha256=LX6ny4xNOWXQO3qWVM8elrSDTqWsj_7jFplax2POS
103
103
  pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
104
104
  pkgs/type_spec/util.py,sha256=Yc7QTZDjlu4ndOu3BwxLy5gRwG2mhnXN_s-iY9SYnIo,4834
105
105
  pkgs/type_spec/actions_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
- pkgs/type_spec/actions_registry/__main__.py,sha256=tnVGrh8stDuhMGimx8dtjz8lPQ89sjHqezR6beTDlF8,4681
107
- pkgs/type_spec/actions_registry/emit_python.py,sha256=6vidMRCQk3qqo9Akz07fy_c2TUkkX_Pb8nXJhyBdDNE,3650
108
- pkgs/type_spec/actions_registry/emit_typescript.py,sha256=F0BRJpXVO8OJzqJgW_mv35D3scdhSpU0PN8HKO0cQIM,6626
106
+ pkgs/type_spec/actions_registry/__main__.py,sha256=hWUnmiG68xeW5GhnIolfHOvPY2GI_kxMgqwtOSgLlvo,4723
107
+ pkgs/type_spec/actions_registry/emit_python.py,sha256=atY1_Z9Ue6r1nBsMeoeX02vQCc_UpAnDLK7gdVNemZ4,3753
108
+ pkgs/type_spec/actions_registry/emit_typescript.py,sha256=XqmbX5OrgjdCGQf4-iNc_aZ7JiXgaVGt1wJcpAUh8SA,6787
109
109
  pkgs/type_spec/parts/base.py.prepart,sha256=1BCL7DCPoot5CYR3O-IpcOvMVthe1cbTQkTiUeZvuk8,2316
110
110
  pkgs/type_spec/parts/base.ts.prepart,sha256=m5aM7AU_42w3Lpbm_s3GYnuFxH3EcUlnFq7zOIE1fDo,1820
111
111
  pkgs/type_spec/type_info/__main__.py,sha256=TLNvCHGcmaj_8Sj5bAQNpuNaaw2dpDzoFDWZds0V4Qo,1002
@@ -122,7 +122,7 @@ uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
122
  uncountable/core/__init__.py,sha256=RFv0kO6rKFf1PtBPu83hCGmxqkJamRtsgQ9_-ztw7tA,341
123
123
  uncountable/core/async_batch.py,sha256=9pYGFzVCQXt8059qFHgutweGIFPquJ5Xfq6NT5P-1K0,1206
124
124
  uncountable/core/client.py,sha256=53Voo2Y-q9iipwwJoHKb-idW41JUOeV8QeWnaLGFf48,16715
125
- uncountable/core/environment.py,sha256=OsUC5URj4VkYFbmZ89MF4gD3vMtIrFKKHSxljXi4oeI,1240
125
+ uncountable/core/environment.py,sha256=Z9vu7JtnSDgQB_KKcZnjTFNyARXjRr_PDW9krwxNNAo,1132
126
126
  uncountable/core/file_upload.py,sha256=BOixJ09uWjZBTrNAlJqNvJEFvaNS2dt7eFq2rG6xP5g,5987
127
127
  uncountable/core/types.py,sha256=s2CjqYJpsmbC7xMwxxT7kJ_V9bwokrjjWVVjpMcQpKI,333
128
128
  uncountable/core/query/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -180,13 +180,7 @@ uncountable/integration/queue_runner/datastore/model.py,sha256=06_fGS0QTALEA_381
180
180
  uncountable/integration/secret_retrieval/__init__.py,sha256=sisf8cxCYcJmCXCKjEPoT2xIxm1j-Ru9iTfMVxH6NM0,171
181
181
  uncountable/integration/secret_retrieval/basic_secret.py,sha256=PfpeaEDwdi8nFlHUJnzCob9GYgGG5O_3mmcaxPPY6zI,3272
182
182
  uncountable/integration/secret_retrieval/retrieve_secret.py,sha256=c0VkCvppWKXwgxdblQuj2WhRaEGBPa7vLDoS6mlNOAQ,3919
183
- uncountable/integration/webhook_server/admin_auth.py,sha256=RYyK54wH5SHfzAVS4CeGgaKHeD4qAhqsvNZqkWuN34Q,1234
184
- uncountable/integration/webhook_server/entrypoint.py,sha256=LT0IDQtCqNoZBtzb-x6Ev96e1Xug3GRv4hn5NUbG_A4,4385
185
- uncountable/integration/webhook_server/admin_routes/__init__.py,sha256=iAgtrlljGe-yBCFNMwz8ZkH_KCC_DgW_hazAZgHb8I8,129
186
- uncountable/integration/webhook_server/admin_routes/_boundary.py,sha256=RKM5LfnMKslRvOBFVi_5iIKDB-3t1RpAVDO5sV1wLIo,1371
187
- uncountable/integration/webhook_server/admin_routes/health.py,sha256=OJ3fwzchLLeS33rIU23cdKnB3rtTxKlHZqqcpUA3Frc,963
188
- uncountable/integration/webhook_server/admin_routes/jobs.py,sha256=TR9VeHB1nZQ2KHTipSXWTxvELWRj9f1KxIOOtRTO3Q0,5112
189
- uncountable/integration/webhook_server/admin_routes/register.py,sha256=Jr1qVEhQgzp8T8zLifAQ5dDAlorFad-1su5kdyvtYWg,501
183
+ uncountable/integration/webhook_server/entrypoint.py,sha256=_1360zLIvEVQVf8ToyK-E2fnaszGKs2HcxcZjNraADc,4268
190
184
  uncountable/types/__init__.py,sha256=7fIYhDsz995jFGK7wBXIVMzIxUJbltUmdqm9U6HA_QQ,14367
191
185
  uncountable/types/async_batch.py,sha256=yCCWrrLQfxXVqZp-KskxLBNkNmuELdz4PJjx8ULppgs,662
192
186
  uncountable/types/async_batch_processor.py,sha256=6Z1qx_H9IqLqp0rzpCtrRvw0DqQ2O5ctkEnw0yNVaV8,48727
@@ -201,7 +195,7 @@ uncountable/types/calculations.py,sha256=fApOFpgBemt_t7IVneVR0VdI3X5EOxiG6Xhzr6R
201
195
  uncountable/types/calculations_t.py,sha256=_K4MDVoxa6AgxlxPrEDBujWhEGWEhUQuE2-ZgiLg9OU,660
202
196
  uncountable/types/chemical_structure.py,sha256=ujyragaD26-QG5jgKnWhO7TN3N1V9b_04T2WhqNYxxo,281
203
197
  uncountable/types/chemical_structure_t.py,sha256=tbA7NBO-vv7Hnk3-ETxc6Pw3wqWeenBG27Y9_bdPCu4,785
204
- uncountable/types/client_base.py,sha256=X_1ccYzdrQHyn4tCyIGhxMlLHdoThx2lcav2tVvQE1A,138269
198
+ uncountable/types/client_base.py,sha256=eM3WCohb2OESAE6OoV7MMWbXV4S6vGMZrEC0Bw4wXGU,138517
205
199
  uncountable/types/client_config.py,sha256=M7FZ0m_lGmBsIYcMn8pm92DdoVzrLpzd8sH6DqTQLKo,456
206
200
  uncountable/types/client_config_t.py,sha256=-YNp-zFvk5OL6_WGwGSx30ToK2bGIOh0kv_HN7KcCys,1796
207
201
  uncountable/types/condition_match.py,sha256=ekDzij7-e1PtVwIslSjD1T9fuBIDr5c_7QPdaasiGJw,262
@@ -213,7 +207,7 @@ uncountable/types/data_t.py,sha256=U_dIh5GcyaJlkrHEI4Qf4TOo1uJX07PYO70sYzzKtTo,2
213
207
  uncountable/types/dataset_measurements.py,sha256=CVwWePUC02B_R_UB86yfNBwnclR-5xpZaiCs2jWtu2A,512
214
208
  uncountable/types/dataset_measurements_t.py,sha256=iVwh-3Z23aXmPJcUJ3s9axPeOs627DElE_dhfj_PRlQ,1711
215
209
  uncountable/types/entity.py,sha256=Zclk1LYcRaYrMDhqyCjMSLEg0fE6_q8LHvV22Qvscgs,566
216
- uncountable/types/entity_t.py,sha256=s8qf6fRnpjyWTveVc0fzs3zL4rUMXD7YrKfwyqgcD6I,29331
210
+ uncountable/types/entity_t.py,sha256=1ysk_fygPjWr3MQlWQYLCZkcpxHGEiwDGebqMTGfaDo,29968
217
211
  uncountable/types/experiment_groups.py,sha256=qUpFOx1AKgzaT_4khCOv5Xs6jwiQGbvHH-GUh3v1nv4,288
218
212
  uncountable/types/experiment_groups_t.py,sha256=QjZBdjnbsD1D-VpPSSV6hBg-Q7mujjKvYtdMewtXNVU,712
219
213
  uncountable/types/exports.py,sha256=VMmxUO2PpV1Y63hZ2AnVor4H-B6aswJ7YpSru_u89lU,334
@@ -298,8 +292,8 @@ uncountable/types/step_relationships.py,sha256=I6t7tj-VmHAhH8YpJPIUFBxPaRiXU_Zg-
298
292
  uncountable/types/step_relationships_t.py,sha256=pS9NJxYUab0XsHnninHXR8V-4ohofSP67iIDIhPR_QI,5306
299
293
  uncountable/types/units.py,sha256=yxuddayiE8cnzrjQiIsURisWc-Vm1F37uyS3fjM--Ao,254
300
294
  uncountable/types/units_t.py,sha256=6u4JAQFzVtaLcKo15JHsDXZ09no5nlHRQKAhGfiySPE,655
301
- uncountable/types/uploader.py,sha256=odT7wkBfXUf1MoFy6W5JzZ-WY8JX0vO6odGOS_C2Voo,1222
302
- uncountable/types/uploader_t.py,sha256=6YAJ-SqBLuzlP3e9VHtS3B2taIoqZO4UEk92d-P2-Y0,6138
295
+ uncountable/types/uploader.py,sha256=k9OEe6jxjlBcc3iiMl5LoLFEIuI-Z0z6-ec3OYMa5nQ,1322
296
+ uncountable/types/uploader_t.py,sha256=YrC8XQpMy6avkOTeBv-ma9iHE3pClJx6ZxgOVykKP3Q,6830
303
297
  uncountable/types/users.py,sha256=R-bFIh07mMl6HyxP8hKmlT-QMbBXZPZ7mVuOIeOlCsg,254
304
298
  uncountable/types/users_t.py,sha256=n2Ldc78cMU8gKynf2u9GvcKdelcKDRkjaOpAUO6Q5m4,678
305
299
  uncountable/types/webhook.py,sha256=ZLXFWaup9ueboI8D4-V3sRGZyb0pFXjzOTywlk8ZfF0,264
@@ -416,7 +410,7 @@ uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=IYm4DA7RN8gvx
416
410
  uncountable/types/api/recipes/get_recipes_data.py,sha256=B_rYOq7TfHVi4pyFN6r5zi5QDzMXhRDw2thlldwO0wQ,8859
417
411
  uncountable/types/api/recipes/lock_recipes.py,sha256=Ez5oWRwq_n16RHli56uaEURGrRYxyIS2VLOJEUQ9kaY,1885
418
412
  uncountable/types/api/recipes/remove_recipe_from_project.py,sha256=h1I3cLUb_zZ3QjpK7IKPT_1gTDPTPbGWg0OJN_rUn6o,1186
419
- uncountable/types/api/recipes/set_recipe_inputs.py,sha256=2NhVAfkIjVTtUKeV1aPLb42wP6XZBerbYKJ_K_HH3kA,2040
413
+ uncountable/types/api/recipes/set_recipe_inputs.py,sha256=Qf3Ny6EkUKZ2QmRba8-K4AfpKHTwGexlxyzCOCjIQsM,2288
420
414
  uncountable/types/api/recipes/set_recipe_metadata.py,sha256=8BT03B4LC5bAJ7lu5LSxdAML5Q58Rejagpm_EVuJUYk,1356
421
415
  uncountable/types/api/recipes/set_recipe_output_annotations.py,sha256=058uueGk-0ILboQy29nnj_jTD6suROEXuXuYsoAib2w,3823
422
416
  uncountable/types/api/recipes/set_recipe_output_file.py,sha256=Jv6zkjvIxWM8o9RiX5p2SRkw1UJt9pzYC-KgG0BZoVY,1915
@@ -439,7 +433,7 @@ uncountable/types/api/uploader/complete_async_parse.py,sha256=Os1HAubxTlbut6Gylj
439
433
  uncountable/types/api/uploader/invoke_uploader.py,sha256=QU1KmAFgGHSWskZEKfaAww8rCj-hVNP0i4kMQE3x3Fc,1822
440
434
  uncountable/types/api/user/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
441
435
  uncountable/types/api/user/get_current_user_info.py,sha256=BT7bGp5SOHz3XdKWhhdZ6acnInafT2PgdJ-H4YH3W7c,1181
442
- uncountablepythonsdk-0.0.182.dist-info/METADATA,sha256=oGJSxcjq_RKLaOjhKMpBEnj3_JRLoewFIegeuf9_ZWI,2211
443
- uncountablepythonsdk-0.0.182.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
444
- uncountablepythonsdk-0.0.182.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
445
- uncountablepythonsdk-0.0.182.dist-info/RECORD,,
436
+ uncountablepythonsdk-0.0.184.dist-info/METADATA,sha256=mC6m3lEpjQAUsOqEx1Vcc7aoLKXtvnvRXmSUTJpJ1Rg,2211
437
+ uncountablepythonsdk-0.0.184.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
438
+ uncountablepythonsdk-0.0.184.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
439
+ uncountablepythonsdk-0.0.184.dist-info/RECORD,,
@@ -1,38 +0,0 @@
1
- import functools
2
- import hmac
3
- from collections.abc import Callable
4
-
5
- import flask
6
- from flask.typing import ResponseReturnValue
7
- from uncountable.core.environment import get_integration_admin_token
8
- from uncountable.integration.http_server import HttpException
9
-
10
- _BEARER_PREFIX = "Bearer "
11
-
12
-
13
- def _extract_bearer_token(authorization_header: str | None) -> str | None:
14
- if authorization_header is None:
15
- return None
16
- if not authorization_header.startswith(_BEARER_PREFIX):
17
- return None
18
- return authorization_header[len(_BEARER_PREFIX) :]
19
-
20
-
21
- def require_admin_auth(
22
- view: Callable[..., ResponseReturnValue],
23
- ) -> Callable[..., ResponseReturnValue]:
24
- @functools.wraps(view)
25
- def wrapper(*args: object, **kwargs: object) -> ResponseReturnValue:
26
- admin_token = get_integration_admin_token()
27
- if admin_token is None:
28
- raise HttpException.service_unavailable()
29
- provided_token = _extract_bearer_token(
30
- flask.request.headers.get("Authorization")
31
- )
32
- if provided_token is None or not hmac.compare_digest(
33
- provided_token, admin_token
34
- ):
35
- raise HttpException.unauthorized()
36
- return view(*args, **kwargs)
37
-
38
- return wrapper
@@ -1,3 +0,0 @@
1
- from uncountable.integration.webhook_server.admin_routes.register import (
2
- register_admin_routes as register_admin_routes,
3
- )
@@ -1,39 +0,0 @@
1
- import functools
2
- from collections.abc import Callable
3
-
4
- import flask
5
- from flask.typing import ResponseReturnValue
6
- from uncountable.integration.http_server import HttpException
7
- from uncountable.integration.queue_runner.command_server.types import (
8
- CommandServerException,
9
- )
10
- from uncountable.integration.telemetry import Logger
11
-
12
-
13
- def register_admin_route(
14
- *,
15
- app: flask.Flask,
16
- logger: Logger,
17
- route: str,
18
- endpoint: str,
19
- view: Callable[..., ResponseReturnValue],
20
- methods: list[str],
21
- ) -> None:
22
- @functools.wraps(view)
23
- def wrapped(*args: object, **kwargs: object) -> ResponseReturnValue:
24
- with logger.push_scope(route):
25
- try:
26
- return view(*args, **kwargs)
27
- except HttpException as e:
28
- return e.make_error_response()
29
- except CommandServerException as e:
30
- logger.log_exception(
31
- e,
32
- message=f"admin route {route} could not reach the command server",
33
- )
34
- return HttpException.bad_gateway().make_error_response()
35
- except Exception as e:
36
- logger.log_exception(e, message=f"unexpected error on {route}")
37
- return HttpException.unknown_error().make_error_response()
38
-
39
- app.add_url_rule(route, endpoint=endpoint, view_func=wrapped, methods=methods)
@@ -1,30 +0,0 @@
1
- import flask
2
- from flask.typing import ResponseReturnValue
3
- from uncountable.core.environment import get_local_admin_server_port
4
- from uncountable.integration.queue_runner.command_server.command_client import (
5
- check_health,
6
- )
7
- from uncountable.integration.telemetry import Logger
8
- from uncountable.integration.webhook_server.admin_auth import require_admin_auth
9
- from uncountable.integration.webhook_server.admin_routes._boundary import (
10
- register_admin_route,
11
- )
12
-
13
- _ADMIN_HEALTH_ROUTE = "/admin/health"
14
-
15
-
16
- @require_admin_auth
17
- def _handle_admin_health() -> ResponseReturnValue:
18
- healthy = check_health(port=get_local_admin_server_port())
19
- return flask.jsonify({"healthy": healthy})
20
-
21
-
22
- def register_health_routes(*, app: flask.Flask, logger: Logger) -> None:
23
- register_admin_route(
24
- app=app,
25
- logger=logger,
26
- route=_ADMIN_HEALTH_ROUTE,
27
- endpoint="admin_health",
28
- view=_handle_admin_health,
29
- methods=["GET"],
30
- )
@@ -1,147 +0,0 @@
1
- import datetime
2
-
3
- import flask
4
- from flask.typing import ResponseReturnValue
5
- from uncountable.core.environment import get_local_admin_server_port
6
- from uncountable.integration.http_server import HttpException
7
- from uncountable.integration.queue_runner.command_server.command_client import (
8
- send_job_cancellation_message,
9
- send_job_queue_message,
10
- send_list_queued_jobs_message,
11
- send_retry_job_message,
12
- )
13
- from uncountable.integration.queue_runner.command_server.protocol.command_server_pb2 import (
14
- ListQueuedJobsResult,
15
- )
16
- from uncountable.integration.telemetry import Logger
17
- from uncountable.integration.webhook_server.admin_auth import require_admin_auth
18
- from uncountable.integration.webhook_server.admin_routes._boundary import (
19
- register_admin_route,
20
- )
21
- from uncountable.types import base_t, queued_job_t
22
-
23
- from pkgs.serialization_util import serialize_for_api
24
-
25
- _ADMIN_JOBS_ROUTE = "/admin/jobs"
26
- _ADMIN_ENQUEUE_JOB_ROUTE = "/admin/jobs/enqueue"
27
- _ADMIN_RETRY_JOB_ROUTE = "/admin/jobs/<job_uuid>/retry"
28
- _ADMIN_CANCEL_JOB_ROUTE = "/admin/jobs/<job_uuid>/cancel"
29
- _DEFAULT_JOBS_LIMIT = 100
30
- _VALID_JOB_STATUSES = {status.value for status in queued_job_t.JobStatus}
31
-
32
-
33
- def _parse_job_status(raw_status: str | None) -> queued_job_t.JobStatus | None:
34
- if raw_status is None:
35
- return None
36
- if raw_status not in _VALID_JOB_STATUSES:
37
- raise HttpException.bad_request(f"invalid status: {raw_status}")
38
- return queued_job_t.JobStatus(raw_status)
39
-
40
-
41
- def _parse_non_negative_int(raw_value: str | None, *, default: int) -> int:
42
- if raw_value is None:
43
- return default
44
- if not raw_value.isdigit():
45
- raise HttpException.bad_request(
46
- f"expected a non-negative integer, got: {raw_value}"
47
- )
48
- return int(raw_value)
49
-
50
-
51
- def _serialize_queued_job(
52
- item: ListQueuedJobsResult.ListQueuedJobsResultItem,
53
- ) -> dict[str, base_t.JsonValue]:
54
- metadata = queued_job_t.QueuedJobMetadata(
55
- queued_job_uuid=item.uuid,
56
- job_ref_name=item.job_ref_name,
57
- num_attempts=item.num_attempts,
58
- status=queued_job_t.JobStatus(item.status),
59
- submitted_at=item.submitted_at.ToDatetime(datetime.timezone.utc),
60
- )
61
- return serialize_for_api(metadata)
62
-
63
-
64
- @require_admin_auth
65
- def _handle_list_jobs() -> ResponseReturnValue:
66
- status = _parse_job_status(flask.request.args.get("status"))
67
- offset = _parse_non_negative_int(flask.request.args.get("offset"), default=0)
68
- limit = _parse_non_negative_int(
69
- flask.request.args.get("limit"), default=_DEFAULT_JOBS_LIMIT
70
- )
71
- jobs = send_list_queued_jobs_message(
72
- status=status, offset=offset, limit=limit, port=get_local_admin_server_port()
73
- )
74
- return flask.jsonify({"jobs": [_serialize_queued_job(job) for job in jobs]})
75
-
76
-
77
- @require_admin_auth
78
- def _handle_enqueue_job() -> ResponseReturnValue:
79
- body = flask.request.get_json(silent=True)
80
- if not isinstance(body, dict):
81
- raise HttpException.bad_request("expected a JSON object body")
82
- job_ref_name = body.get("job_ref_name")
83
- if not isinstance(job_ref_name, str):
84
- raise HttpException.bad_request("job_ref_name is required")
85
- webhook_payload = body.get("webhook_payload")
86
- invocation_context: queued_job_t.InvocationContext = (
87
- queued_job_t.InvocationContextManual()
88
- if webhook_payload is None
89
- else queued_job_t.InvocationContextWebhook(webhook_payload=webhook_payload)
90
- )
91
- queued_job_uuid = send_job_queue_message(
92
- job_ref_name=job_ref_name,
93
- payload=queued_job_t.QueuedJobPayload(invocation_context=invocation_context),
94
- port=get_local_admin_server_port(),
95
- )
96
- return flask.jsonify({"queuedJobUuid": queued_job_uuid})
97
-
98
-
99
- @require_admin_auth
100
- def _handle_retry_job(job_uuid: str) -> ResponseReturnValue:
101
- queued_job_uuid = send_retry_job_message(
102
- job_uuid=job_uuid, port=get_local_admin_server_port()
103
- )
104
- return flask.jsonify({"queuedJobUuid": queued_job_uuid})
105
-
106
-
107
- @require_admin_auth
108
- def _handle_cancel_job(job_uuid: str) -> ResponseReturnValue:
109
- status = send_job_cancellation_message(
110
- queued_job_uuid=job_uuid, port=get_local_admin_server_port()
111
- )
112
- return flask.jsonify({"status": status.value})
113
-
114
-
115
- def register_job_routes(*, app: flask.Flask, logger: Logger) -> None:
116
- register_admin_route(
117
- app=app,
118
- logger=logger,
119
- route=_ADMIN_JOBS_ROUTE,
120
- endpoint="admin_list_jobs",
121
- view=_handle_list_jobs,
122
- methods=["GET"],
123
- )
124
- register_admin_route(
125
- app=app,
126
- logger=logger,
127
- route=_ADMIN_ENQUEUE_JOB_ROUTE,
128
- endpoint="admin_enqueue_job",
129
- view=_handle_enqueue_job,
130
- methods=["POST"],
131
- )
132
- register_admin_route(
133
- app=app,
134
- logger=logger,
135
- route=_ADMIN_RETRY_JOB_ROUTE,
136
- endpoint="admin_retry_job",
137
- view=_handle_retry_job,
138
- methods=["POST"],
139
- )
140
- register_admin_route(
141
- app=app,
142
- logger=logger,
143
- route=_ADMIN_CANCEL_JOB_ROUTE,
144
- endpoint="admin_cancel_job",
145
- view=_handle_cancel_job,
146
- methods=["POST"],
147
- )
@@ -1,13 +0,0 @@
1
- import flask
2
- from opentelemetry.trace import get_current_span
3
- from uncountable.integration.telemetry import Logger
4
- from uncountable.integration.webhook_server.admin_routes.health import (
5
- register_health_routes,
6
- )
7
- from uncountable.integration.webhook_server.admin_routes.jobs import register_job_routes
8
-
9
-
10
- def register_admin_routes(app: flask.Flask) -> None:
11
- logger = Logger(get_current_span())
12
- register_health_routes(app=app, logger=logger)
13
- register_job_routes(app=app, logger=logger)