sapiopycommons 2025.9.8a731__py3-none-any.whl → 2025.9.9a736__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 sapiopycommons might be problematic. Click here for more details.
- sapiopycommons/ai/tool_of_tools.py +917 -0
- sapiopycommons/callbacks/callback_util.py +26 -16
- sapiopycommons/eln/experiment_handler.py +12 -5
- sapiopycommons/files/assay_plate_reader.py +93 -0
- sapiopycommons/files/file_text_converter.py +207 -0
- sapiopycommons/flowcyto/flow_cyto.py +2 -24
- sapiopycommons/general/accession_service.py +2 -28
- sapiopycommons/multimodal/multimodal.py +2 -24
- sapiopycommons/recordmodel/record_handler.py +4 -0
- sapiopycommons/rules/eln_rule_handler.py +3 -0
- sapiopycommons/rules/on_save_rule_handler.py +3 -0
- sapiopycommons/webhook/webservice_handlers.py +1 -1
- {sapiopycommons-2025.9.8a731.dist-info → sapiopycommons-2025.9.9a736.dist-info}/METADATA +2 -2
- {sapiopycommons-2025.9.8a731.dist-info → sapiopycommons-2025.9.9a736.dist-info}/RECORD +16 -49
- sapiopycommons/ai/converter_service_base.py +0 -132
- sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.py +0 -43
- sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.pyi +0 -31
- sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.py +0 -123
- sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.pyi +0 -598
- sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/plan/converter/converter_pb2.py +0 -51
- sapiopycommons/ai/protoapi/plan/converter/converter_pb2.pyi +0 -63
- sapiopycommons/ai/protoapi/plan/converter/converter_pb2_grpc.py +0 -149
- sapiopycommons/ai/protoapi/plan/item/item_container_pb2.py +0 -55
- sapiopycommons/ai/protoapi/plan/item/item_container_pb2.pyi +0 -90
- sapiopycommons/ai/protoapi/plan/item/item_container_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/plan/script/script_pb2.py +0 -59
- sapiopycommons/ai/protoapi/plan/script/script_pb2.pyi +0 -102
- sapiopycommons/ai/protoapi/plan/script/script_pb2_grpc.py +0 -153
- sapiopycommons/ai/protoapi/plan/step_output_pb2.py +0 -45
- sapiopycommons/ai/protoapi/plan/step_output_pb2.pyi +0 -42
- sapiopycommons/ai/protoapi/plan/step_output_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/plan/step_pb2.py +0 -43
- sapiopycommons/ai/protoapi/plan/step_pb2.pyi +0 -43
- sapiopycommons/ai/protoapi/plan/step_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/plan/tool/entry_pb2.py +0 -41
- sapiopycommons/ai/protoapi/plan/tool/entry_pb2.pyi +0 -35
- sapiopycommons/ai/protoapi/plan/tool/entry_pb2_grpc.py +0 -24
- sapiopycommons/ai/protoapi/plan/tool/tool_pb2.py +0 -75
- sapiopycommons/ai/protoapi/plan/tool/tool_pb2.pyi +0 -237
- sapiopycommons/ai/protoapi/plan/tool/tool_pb2_grpc.py +0 -154
- sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.py +0 -39
- sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.pyi +0 -32
- sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2_grpc.py +0 -24
- sapiopycommons/ai/protobuf_utils.py +0 -504
- sapiopycommons/ai/server.py +0 -132
- sapiopycommons/ai/test_client.py +0 -356
- sapiopycommons/ai/tool_service_base.py +0 -975
- sapiopycommons/files/temp_files.py +0 -49
- {sapiopycommons-2025.9.8a731.dist-info → sapiopycommons-2025.9.9a736.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.9.8a731.dist-info → sapiopycommons-2025.9.9a736.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import shutil
|
|
3
|
-
import tempfile
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# FR-47422: Created class.
|
|
7
|
-
class TempFileHandler:
|
|
8
|
-
"""
|
|
9
|
-
A utility class to manage temporary files and directories.
|
|
10
|
-
"""
|
|
11
|
-
directories: list[str]
|
|
12
|
-
files: list[str]
|
|
13
|
-
|
|
14
|
-
def __init__(self) -> None:
|
|
15
|
-
self.directories = []
|
|
16
|
-
self.files = []
|
|
17
|
-
|
|
18
|
-
def create_temp_directory(self) -> str:
|
|
19
|
-
"""
|
|
20
|
-
:return: The path to a newly created temporary directory.
|
|
21
|
-
"""
|
|
22
|
-
directory: str = tempfile.mkdtemp()
|
|
23
|
-
self.directories.append(directory)
|
|
24
|
-
return directory
|
|
25
|
-
|
|
26
|
-
def create_temp_file(self, data: str | bytes, suffix: str = "") -> str:
|
|
27
|
-
"""
|
|
28
|
-
:param data: The data to write to the temporary file.
|
|
29
|
-
:param suffix: An optional suffix for the temporary file.
|
|
30
|
-
:return: The path to a newly created temporary file containing the provided data.
|
|
31
|
-
"""
|
|
32
|
-
mode: str = 'w' if isinstance(data, str) else 'wb'
|
|
33
|
-
with tempfile.NamedTemporaryFile(mode=mode, suffix=suffix, delete=False) as tmp_file:
|
|
34
|
-
tmp_file.write(data)
|
|
35
|
-
file_path: str = tmp_file.name
|
|
36
|
-
self.files.append(file_path)
|
|
37
|
-
return file_path
|
|
38
|
-
|
|
39
|
-
def cleanup(self) -> None:
|
|
40
|
-
"""
|
|
41
|
-
Delete all temporary files and directories created by this handler.
|
|
42
|
-
"""
|
|
43
|
-
for directory in self.directories:
|
|
44
|
-
if os.path.exists(directory):
|
|
45
|
-
shutil.rmtree(directory)
|
|
46
|
-
|
|
47
|
-
for file_path in self.files:
|
|
48
|
-
if os.path.exists(file_path):
|
|
49
|
-
os.remove(file_path)
|
|
File without changes
|
{sapiopycommons-2025.9.8a731.dist-info → sapiopycommons-2025.9.9a736.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|