clerk-sdk 0.5.10__py3-none-any.whl → 0.5.11__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.
clerk/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .client import Clerk
2
2
 
3
3
 
4
- __version__ = "0.5.10"
4
+ __version__ = "0.5.11"
clerk/client.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Any, Dict, List, Literal
1
+ from typing import Any, Dict, List, Literal, cast
2
2
 
3
3
  from clerk.base import BaseClerk
4
4
  from clerk.models.document import Document, GetDocumentsRequest, UploadDocumentRequest
@@ -73,21 +73,23 @@ class Clerk(BaseClerk):
73
73
 
74
74
  def prevalidate_file(
75
75
  self, project_id: str, workflow_id: str, file: UploadFile
76
- ) -> Dict[str, Any]:
76
+ ) -> str:
77
77
  """Submit a prevalidation for a specific file. Returns the id for fetching the results later."""
78
78
  endpoint = f"/prevalidation/file"
79
- files_data = [file.to_multipart_format()]
79
+ files_data = [file.to_multipart_format(key="file")]
80
80
  res = self.post_request(
81
81
  endpoint,
82
82
  files=files_data,
83
83
  data={"project_id": project_id, "workflow_id": workflow_id},
84
84
  )
85
- return res.data[0]
85
+ return cast(str, res.data[0])
86
86
 
87
87
  def get_prevalidation_results(
88
88
  self, workflow_run_id: str
89
- ) -> FileClassificationResponse:
89
+ ) -> FileClassificationResponse | None:
90
90
  """Fetch the results of a previously submitted prevalidation."""
91
91
  endpoint = f"/prevalidation/file"
92
92
  res = self.get_request(endpoint, params={"workflow_run_id": workflow_run_id})
93
+ if not res.data:
94
+ return None
93
95
  return FileClassificationResponse(**res.data[0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clerk-sdk
3
- Version: 0.5.10
3
+ Version: 0.5.11
4
4
  Summary: Library for interacting with Clerk
5
5
  Project-URL: Homepage, https://github.com/F-ONE-Group/clerk_pypi
6
6
  Author-email: F-One <contact@f-one.group>
@@ -1,6 +1,6 @@
1
- clerk/__init__.py,sha256=guyotbECs9C88el84Xes-MMJ_X80QdLi8y-tOQFXK9s,51
1
+ clerk/__init__.py,sha256=TgQHVvVyqe6XGQBjFfgoMaYHKaFPSzYZiyxASecQ2iU,51
2
2
  clerk/base.py,sha256=lbFTdpdDfsmYIQUFH93S1aw0-L6GNJwAcubW1tdMFX4,3967
3
- clerk/client.py,sha256=Es6FyRlxXhiHBag2Hhy3gw5aQyP3Nlfn3Nt01C-VJt0,3519
3
+ clerk/client.py,sha256=3jvszxm-minbarXtpymTSu5iKXqfXF4ts0uZGmsC-8I,3591
4
4
  clerk/decorator/__init__.py,sha256=yGGcS17VsZ7cZ-hVGCm3I3vGDJMiJIAqmDGzriIi0DI,65
5
5
  clerk/decorator/models.py,sha256=nFMdVSG3nJ4hrEXs9YbI_GgjHbVjhSWZokOCzUh-lqQ,521
6
6
  clerk/decorator/task_decorator.py,sha256=H8caRvNvvl-IRwyREP66gBGVM-SpQJ1W7oAFImO-6Jw,3769
@@ -64,8 +64,8 @@ clerk/models/ui_operator.py,sha256=mKTJUFZgv7PeEt5oys28HVZxHOJsofmRQOcRpqj0dbU,2
64
64
  clerk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  clerk/utils/logger.py,sha256=NrMIlJfVmRjjRw_N_Jngkl0qqv7btXUbg5wxcRmFEH4,3800
66
66
  clerk/utils/save_artifact.py,sha256=94aYkYNVGcSUaSWZmdjiY6Oc-3yCKb2XWCZ56IAXQqk,1158
67
- clerk_sdk-0.5.10.dist-info/METADATA,sha256=QRgxgexHqT-Vp5kTDuMk6u66m-RVtxEdbEb9YSAvjsE,9636
68
- clerk_sdk-0.5.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
69
- clerk_sdk-0.5.10.dist-info/entry_points.txt,sha256=VoUmW07sRRSioms5pqQ4A6CYxNEyhGA93GtyBlB_wGw,53
70
- clerk_sdk-0.5.10.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
71
- clerk_sdk-0.5.10.dist-info/RECORD,,
67
+ clerk_sdk-0.5.11.dist-info/METADATA,sha256=q58VQdgwpWlrCHvVQbC09jcr5myHV1DnqSLnrzRZgmY,9636
68
+ clerk_sdk-0.5.11.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
69
+ clerk_sdk-0.5.11.dist-info/entry_points.txt,sha256=VoUmW07sRRSioms5pqQ4A6CYxNEyhGA93GtyBlB_wGw,53
70
+ clerk_sdk-0.5.11.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
71
+ clerk_sdk-0.5.11.dist-info/RECORD,,