clerk-sdk 0.2.8__tar.gz → 0.3.0__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 (62) hide show
  1. {clerk_sdk-0.2.8/clerk_sdk.egg-info → clerk_sdk-0.3.0}/PKG-INFO +1 -1
  2. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/decorator/task_decorator.py +7 -1
  3. clerk_sdk-0.3.0/clerk/exceptions/exceptions.py +13 -0
  4. clerk_sdk-0.3.0/clerk/exceptions/remote_device.py +4 -0
  5. clerk_sdk-0.3.0/clerk/utils/__init__.py +0 -0
  6. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/utils/logger.py +3 -3
  7. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/utils/save_artifact.py +3 -3
  8. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0/clerk_sdk.egg-info}/PKG-INFO +1 -1
  9. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk_sdk.egg-info/SOURCES.txt +3 -0
  10. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/setup.py +1 -1
  11. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/LICENSE +0 -0
  12. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/MANIFEST.in +0 -0
  13. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/README.md +0 -0
  14. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/__init__.py +0 -0
  15. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/base.py +0 -0
  16. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/client.py +0 -0
  17. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/decorator/__init__.py +0 -0
  18. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/decorator/models.py +0 -0
  19. {clerk_sdk-0.2.8/clerk/gui_automation → clerk_sdk-0.3.0/clerk/exceptions}/__init__.py +0 -0
  20. {clerk_sdk-0.2.8/clerk/gui_automation/action_model → clerk_sdk-0.3.0/clerk/gui_automation}/__init__.py +0 -0
  21. {clerk_sdk-0.2.8/clerk/gui_automation/exceptions → clerk_sdk-0.3.0/clerk/gui_automation/action_model}/__init__.py +0 -0
  22. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/action_model/model.py +0 -0
  23. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/action_model/utils.py +0 -0
  24. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/client.py +0 -0
  25. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/client_actor/__init__.py +0 -0
  26. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/client_actor/client_actor.py +0 -0
  27. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/client_actor/exception.py +0 -0
  28. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/client_actor/model.py +0 -0
  29. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/decorators/__init__.py +0 -0
  30. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/decorators/gui_automation.py +0 -0
  31. {clerk_sdk-0.2.8/clerk/gui_automation/exceptions/modality → clerk_sdk-0.3.0/clerk/gui_automation/exceptions}/__init__.py +0 -0
  32. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/exceptions/agent_manager.py +0 -0
  33. {clerk_sdk-0.2.8/clerk/gui_automation/ui_state_inspector → clerk_sdk-0.3.0/clerk/gui_automation/exceptions/modality}/__init__.py +0 -0
  34. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/exceptions/modality/exc.py +0 -0
  35. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/exceptions/websocket.py +0 -0
  36. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/requirements.txt +0 -0
  37. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_actions/__init__.py +0 -0
  38. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_actions/actions.py +0 -0
  39. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_actions/base.py +0 -0
  40. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_actions/support.py +0 -0
  41. {clerk_sdk-0.2.8/clerk/models → clerk_sdk-0.3.0/clerk/gui_automation/ui_state_inspector}/__init__.py +0 -0
  42. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_inspector/gui_vision.py +0 -0
  43. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_inspector/models.py +0 -0
  44. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/__init__.py +0 -0
  45. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/ai_recovery.py +0 -0
  46. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/decorators.py +0 -0
  47. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/exceptions.py +0 -0
  48. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/models.py +0 -0
  49. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/gui_automation/ui_state_machine/state_machine.py +0 -0
  50. {clerk_sdk-0.2.8/clerk/utils → clerk_sdk-0.3.0/clerk/models}/__init__.py +0 -0
  51. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/document.py +0 -0
  52. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/document_statuses.py +0 -0
  53. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/file.py +0 -0
  54. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/remote_device.py +0 -0
  55. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/response_model.py +0 -0
  56. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk/models/ui_operator.py +0 -0
  57. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk_sdk.egg-info/dependency_links.txt +0 -0
  58. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk_sdk.egg-info/requires.txt +0 -0
  59. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/clerk_sdk.egg-info/top_level.txt +0 -0
  60. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/pyproject.toml +0 -0
  61. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/requirements.txt +0 -0
  62. {clerk_sdk-0.2.8 → clerk_sdk-0.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clerk-sdk
3
- Version: 0.2.8
3
+ Version: 0.3.0
4
4
  Summary: Library for interacting with Clerk
5
5
  Home-page: https://github.com/F-ONE-Group/clerk_pypi
6
6
  Author: F-ONE Group
@@ -1,7 +1,10 @@
1
1
  import os
2
2
  import pickle
3
+ import traceback
3
4
  from typing import Callable, Optional
4
5
  from functools import wraps
6
+
7
+ from clerk.exceptions.exceptions import ApplicationException
5
8
  from .models import ClerkCodePayload
6
9
 
7
10
  input_pkl: str = "/app/data/input/input.pkl"
@@ -35,7 +38,10 @@ def clerk_code():
35
38
  if not isinstance(output, ClerkCodePayload):
36
39
  raise TypeError("Function must return a ClerkCodePayload instance.")
37
40
  except Exception as e:
38
- output = e
41
+ # parse no standard errors into the standard Application Error
42
+ output = ApplicationException(
43
+ type=str(type(e)), message=str(e), traceback=traceback.format_exc()
44
+ )
39
45
 
40
46
  # 3. write to output.pkl
41
47
  try:
@@ -0,0 +1,13 @@
1
+ from typing import Optional
2
+
3
+
4
+ class AppBaseException(Exception):
5
+ def __init__(self, type_: str, message: str, traceback: Optional[str] = None):
6
+ super().__init__(message)
7
+ self.type = type_
8
+ self.message = message
9
+ self.traceback = traceback
10
+
11
+
12
+ class ApplicationException(AppBaseException):
13
+ pass
@@ -0,0 +1,4 @@
1
+ class RemoteDeviceAllocationError(Exception):
2
+ """Exception raised when there is an error allocating a remote device."""
3
+
4
+ pass
File without changes
@@ -79,11 +79,11 @@ def _log(level: str, message: str):
79
79
  _log_to_console("INFO", "module_name", "This is an info message")
80
80
 
81
81
  """
82
- # Get run_id from environment variable or default to "unknown"
83
- run_id = os.getenv("_RUN_ID", "unknown")
82
+ # Get artifact folder from environment variable or default to "unknown"
83
+ _artifacts_folder = os.getenv("_artifacts_folder", "unknown")
84
84
 
85
85
  # Create the base path for artifacts
86
- logs_path = os.path.join(base_path, run_id)
86
+ logs_path = os.path.join(base_path, _artifacts_folder)
87
87
  os.makedirs(logs_path, exist_ok=True)
88
88
  # Define the log file path
89
89
  log_file_path = os.path.join(logs_path, "logs.txt")
@@ -18,11 +18,11 @@ def save_artifact(
18
18
  str: The path to the saved artifact.
19
19
  """
20
20
 
21
- # get the run ID from environment variable or default to "unknown"
22
- run_id = os.getenv("_RUN_ID", "unknown")
21
+ # get the artifact folder from environment variable or default to "unknown"
22
+ _artifacts_folder = os.getenv("_artifacts_folder", "unknown")
23
23
 
24
24
  # create the base path for artifacts
25
- base_path = os.path.join(os.getcwd(), "data", "artifacts", run_id)
25
+ base_path = os.path.join(os.getcwd(), "data", "artifacts", _artifacts_folder)
26
26
  if subfolder:
27
27
  base_path = os.path.join(base_path, subfolder)
28
28
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clerk-sdk
3
- Version: 0.2.8
3
+ Version: 0.3.0
4
4
  Summary: Library for interacting with Clerk
5
5
  Home-page: https://github.com/F-ONE-Group/clerk_pypi
6
6
  Author: F-ONE Group
@@ -10,6 +10,9 @@ clerk/client.py
10
10
  clerk/decorator/__init__.py
11
11
  clerk/decorator/models.py
12
12
  clerk/decorator/task_decorator.py
13
+ clerk/exceptions/__init__.py
14
+ clerk/exceptions/exceptions.py
15
+ clerk/exceptions/remote_device.py
13
16
  clerk/gui_automation/__init__.py
14
17
  clerk/gui_automation/client.py
15
18
  clerk/gui_automation/requirements.txt
@@ -13,7 +13,7 @@ gui_requirements = get_requirements("./clerk/gui_automation")
13
13
 
14
14
  setup(
15
15
  name="clerk-sdk",
16
- version="0.2.8",
16
+ version="0.3.0",
17
17
  description="Library for interacting with Clerk",
18
18
  long_description=open("README.md").read(),
19
19
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes