worqhat 3.1.0__tar.gz → 3.4.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 (96) hide show
  1. worqhat-3.4.0/.release-please-manifest.json +3 -0
  2. {worqhat-3.1.0 → worqhat-3.4.0}/CHANGELOG.md +10 -17
  3. {worqhat-3.1.0 → worqhat-3.4.0}/PKG-INFO +49 -15
  4. {worqhat-3.1.0 → worqhat-3.4.0}/README.md +48 -14
  5. worqhat-3.4.0/api.md +63 -0
  6. worqhat-3.4.0/bin/publish-pypi +6 -0
  7. {worqhat-3.1.0 → worqhat-3.4.0}/pyproject.toml +1 -1
  8. worqhat-3.4.0/requirements-dev.lock +135 -0
  9. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_base_client.py +4 -1
  10. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_client.py +24 -16
  11. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_files.py +5 -5
  12. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_version.py +1 -1
  13. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/resources/__init__.py +14 -0
  14. worqhat-3.4.0/src/worqhat/resources/db.py +593 -0
  15. worqhat-3.4.0/src/worqhat/resources/flows.py +437 -0
  16. worqhat-3.4.0/src/worqhat/types/__init__.py +22 -0
  17. worqhat-3.4.0/src/worqhat/types/db_delete_records_params.py +15 -0
  18. worqhat-3.4.0/src/worqhat/types/db_delete_records_response.py +18 -0
  19. worqhat-3.4.0/src/worqhat/types/db_execute_query_params.py +12 -0
  20. worqhat-3.4.0/src/worqhat/types/db_execute_query_response.py +21 -0
  21. worqhat-3.4.0/src/worqhat/types/db_insert_record_params.py +15 -0
  22. worqhat-3.4.0/src/worqhat/types/db_insert_record_response.py +15 -0
  23. worqhat-3.4.0/src/worqhat/types/db_process_nl_query_params.py +15 -0
  24. worqhat-3.4.0/src/worqhat/types/db_process_nl_query_response.py +18 -0
  25. worqhat-3.4.0/src/worqhat/types/db_update_records_params.py +18 -0
  26. worqhat-3.4.0/src/worqhat/types/db_update_records_response.py +18 -0
  27. worqhat-3.1.0/src/worqhat/types/flow_retrieve_metrics_params.py → worqhat-3.4.0/src/worqhat/types/flow_get_metrics_params.py +2 -2
  28. worqhat-3.1.0/src/worqhat/types/flow_retrieve_metrics_response.py → worqhat-3.4.0/src/worqhat/types/flow_get_metrics_response.py +2 -2
  29. worqhat-3.4.0/src/worqhat/types/flow_trigger_with_file_params.py +17 -0
  30. worqhat-3.4.0/src/worqhat/types/flow_trigger_with_file_response.py +18 -0
  31. worqhat-3.4.0/src/worqhat/types/flow_trigger_with_payload_params.py +12 -0
  32. worqhat-3.4.0/src/worqhat/types/flow_trigger_with_payload_response.py +20 -0
  33. worqhat-3.1.0/src/worqhat/types/retrieve_server_info_response.py → worqhat-3.4.0/src/worqhat/types/get_server_info_response.py +2 -2
  34. {worqhat-3.1.0 → worqhat-3.4.0}/tests/api_resources/test_client.py +19 -19
  35. worqhat-3.4.0/tests/api_resources/test_db.py +430 -0
  36. worqhat-3.4.0/tests/api_resources/test_flows.py +327 -0
  37. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_client.py +43 -21
  38. worqhat-3.1.0/.release-please-manifest.json +0 -3
  39. worqhat-3.1.0/api.md +0 -35
  40. worqhat-3.1.0/bin/manual-publish-pypi +0 -62
  41. worqhat-3.1.0/bin/publish-pypi +0 -8
  42. worqhat-3.1.0/requirements-dev.lock +0 -135
  43. worqhat-3.1.0/src/worqhat/resources/flows.py +0 -223
  44. worqhat-3.1.0/src/worqhat/types/__init__.py +0 -8
  45. worqhat-3.1.0/tests/api_resources/test_flows.py +0 -103
  46. {worqhat-3.1.0 → worqhat-3.4.0}/.gitignore +0 -0
  47. {worqhat-3.1.0 → worqhat-3.4.0}/CONTRIBUTING.md +0 -0
  48. {worqhat-3.1.0 → worqhat-3.4.0}/LICENSE +0 -0
  49. {worqhat-3.1.0 → worqhat-3.4.0}/SECURITY.md +0 -0
  50. {worqhat-3.1.0 → worqhat-3.4.0}/bin/check-release-environment +0 -0
  51. {worqhat-3.1.0 → worqhat-3.4.0}/examples/.keep +0 -0
  52. {worqhat-3.1.0 → worqhat-3.4.0}/mypy.ini +0 -0
  53. {worqhat-3.1.0 → worqhat-3.4.0}/noxfile.py +0 -0
  54. {worqhat-3.1.0 → worqhat-3.4.0}/release-please-config.json +0 -0
  55. {worqhat-3.1.0 → worqhat-3.4.0}/requirements.lock +0 -0
  56. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/__init__.py +0 -0
  57. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_compat.py +0 -0
  58. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_constants.py +0 -0
  59. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_exceptions.py +0 -0
  60. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_models.py +0 -0
  61. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_qs.py +0 -0
  62. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_resource.py +0 -0
  63. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_response.py +0 -0
  64. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_streaming.py +0 -0
  65. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_types.py +0 -0
  66. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/__init__.py +0 -0
  67. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_logs.py +0 -0
  68. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_proxy.py +0 -0
  69. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_reflection.py +0 -0
  70. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_resources_proxy.py +0 -0
  71. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_streams.py +0 -0
  72. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_sync.py +0 -0
  73. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_transform.py +0 -0
  74. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_typing.py +0 -0
  75. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/_utils/_utils.py +0 -0
  76. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/lib/.keep +0 -0
  77. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/py.typed +0 -0
  78. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/resources/health.py +0 -0
  79. {worqhat-3.1.0 → worqhat-3.4.0}/src/worqhat/types/health_check_response.py +0 -0
  80. {worqhat-3.1.0 → worqhat-3.4.0}/tests/__init__.py +0 -0
  81. {worqhat-3.1.0 → worqhat-3.4.0}/tests/api_resources/__init__.py +0 -0
  82. {worqhat-3.1.0 → worqhat-3.4.0}/tests/api_resources/test_health.py +0 -0
  83. {worqhat-3.1.0 → worqhat-3.4.0}/tests/conftest.py +0 -0
  84. {worqhat-3.1.0 → worqhat-3.4.0}/tests/sample_file.txt +0 -0
  85. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_deepcopy.py +0 -0
  86. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_extract_files.py +0 -0
  87. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_files.py +0 -0
  88. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_models.py +0 -0
  89. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_qs.py +0 -0
  90. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_required_args.py +0 -0
  91. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_response.py +0 -0
  92. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_streaming.py +0 -0
  93. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_transform.py +0 -0
  94. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_utils/test_proxy.py +0 -0
  95. {worqhat-3.1.0 → worqhat-3.4.0}/tests/test_utils/test_typing.py +0 -0
  96. {worqhat-3.1.0 → worqhat-3.4.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.4.0"
3
+ }
@@ -1,27 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 3.1.0 (2025-07-24)
3
+ ## 3.4.0 (2025-07-31)
4
4
 
5
- Full Changelog: [v3.1.0-alpha.3...v3.1.0](https://github.com/WorqHat/worqhat-python-sdk/compare/v3.1.0-alpha.3...v3.1.0)
6
-
7
- ## 3.1.0-alpha.3 (2025-07-24)
8
-
9
- Full Changelog: [v3.1.0-alpha.2...v3.1.0-alpha.3](https://github.com/WorqHat/worqhat-python-sdk/compare/v3.1.0-alpha.2...v3.1.0-alpha.3)
10
-
11
- ## 3.1.0-alpha.2 (2025-07-24)
12
-
13
- Full Changelog: [v3.1.0-alpha.1...v3.1.0-alpha.2](https://github.com/WorqHat/worqhat-python-sdk/compare/v3.1.0-alpha.1...v3.1.0-alpha.2)
5
+ Full Changelog: [v0.0.1-alpha.0...v3.4.0](https://github.com/WorqHat/worqhat-python-sdk/compare/v0.0.1-alpha.0...v3.4.0)
14
6
 
15
7
  ### Features
16
8
 
9
+ * **api:** update via SDK Studio ([ce75dcc](https://github.com/WorqHat/worqhat-python-sdk/commit/ce75dcc31b078bab025560c5b196a4eecf7f1227))
10
+ * **api:** update via SDK Studio ([ec19825](https://github.com/WorqHat/worqhat-python-sdk/commit/ec19825709fbe7994a811981d5eb77630a0594ce))
17
11
  * **api:** update via SDK Studio ([85ab7a2](https://github.com/WorqHat/worqhat-python-sdk/commit/85ab7a2e5c871ed5921ef6044c0f9926b939948d))
18
-
19
- ## 3.1.0-alpha.1 (2025-07-24)
20
-
21
- Full Changelog: [v0.0.1-alpha.0...v3.1.0-alpha.1](https://github.com/WorqHat/worqhat-python-sdk/compare/v0.0.1-alpha.0...v3.1.0-alpha.1)
22
-
23
- ### Features
24
-
25
12
  * **api:** update via SDK Studio ([1dca18a](https://github.com/WorqHat/worqhat-python-sdk/commit/1dca18acf452a7cc35c6e541d69b8a31ac90d29a))
26
13
  * **api:** update via SDK Studio ([fbb6ab5](https://github.com/WorqHat/worqhat-python-sdk/commit/fbb6ab5d66c30d8ee3bd9328eab85304efd42614))
27
14
 
@@ -29,7 +16,13 @@ Full Changelog: [v0.0.1-alpha.0...v3.1.0-alpha.1](https://github.com/WorqHat/wor
29
16
  ### Chores
30
17
 
31
18
  * configure new SDK language ([c4d0258](https://github.com/WorqHat/worqhat-python-sdk/commit/c4d0258ea522088e0f6181228d1f04a64230b2d7))
19
+ * sync repo ([b2b1c38](https://github.com/WorqHat/worqhat-python-sdk/commit/b2b1c381aa08870a807c303164f6ff9689f8aea2))
32
20
  * sync repo ([4766968](https://github.com/WorqHat/worqhat-python-sdk/commit/476696875aa8f142f588c4f016fa8110a0ec4e08))
21
+ * update SDK settings ([8d58885](https://github.com/WorqHat/worqhat-python-sdk/commit/8d5888563b3042cb684d9a4406a09edd2be22889))
22
+ * update SDK settings ([a1ff3c3](https://github.com/WorqHat/worqhat-python-sdk/commit/a1ff3c388307c293932c8ef069ae9ad3a03c393c))
23
+ * update SDK settings ([53e95ac](https://github.com/WorqHat/worqhat-python-sdk/commit/53e95acd14d9d4dd063c1c71a1ed0bcd9ab86e69))
24
+ * update SDK settings ([f5a73c5](https://github.com/WorqHat/worqhat-python-sdk/commit/f5a73c54db1e7d7d865701c79b13034a08ef5341))
25
+ * update SDK settings ([9ff0620](https://github.com/WorqHat/worqhat-python-sdk/commit/9ff062000f153819b5629a262395551a723b2382))
33
26
  * update SDK settings ([d605766](https://github.com/WorqHat/worqhat-python-sdk/commit/d605766da0d10451b716cbf715c96e6b4ccf90b9))
34
27
  * update SDK settings ([29497ca](https://github.com/WorqHat/worqhat-python-sdk/commit/29497ca3d7fc8232a9b0cc0fb70cb963c4624b33))
35
28
  * update SDK settings ([e386fb8](https://github.com/WorqHat/worqhat-python-sdk/commit/e386fb86761c1ef06bd99b5a85b2fd6710d17737))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worqhat
3
- Version: 3.1.0
3
+ Version: 3.4.0
4
4
  Summary: The official Python library for the worqhat API
5
5
  Project-URL: Homepage, https://github.com/WorqHat/worqhat-python-sdk
6
6
  Project-URL: Repository, https://github.com/WorqHat/worqhat-python-sdk
@@ -46,7 +46,7 @@ It is generated with [Stainless](https://www.stainless.com/).
46
46
 
47
47
  ## Documentation
48
48
 
49
- The REST API documentation can be found on [docs.worqhat.com](https://docs.worqhat.com). The full API of this library can be found in [api.md](https://github.com/WorqHat/worqhat-python-sdk/tree/main/api.md).
49
+ The REST API documentation can be found on [worqhat.com](https://worqhat.com/support). The full API of this library can be found in [api.md](https://github.com/WorqHat/worqhat-python-sdk/tree/main/api.md).
50
50
 
51
51
  ## Installation
52
52
 
@@ -67,8 +67,10 @@ client = Worqhat(
67
67
  api_key=os.environ.get("WORQHAT_API_KEY"), # This is the default and can be omitted
68
68
  )
69
69
 
70
- response = client.retrieve_server_info()
71
- print(response.environment)
70
+ response = client.db.execute_query(
71
+ query="REPLACE_ME",
72
+ )
73
+ print(response.data)
72
74
  ```
73
75
 
74
76
  While you can provide an `api_key` keyword argument,
@@ -91,8 +93,10 @@ client = AsyncWorqhat(
91
93
 
92
94
 
93
95
  async def main() -> None:
94
- response = await client.retrieve_server_info()
95
- print(response.environment)
96
+ response = await client.db.execute_query(
97
+ query="REPLACE_ME",
98
+ )
99
+ print(response.data)
96
100
 
97
101
 
98
102
  asyncio.run(main())
@@ -124,8 +128,10 @@ async def main() -> None:
124
128
  api_key="My API Key",
125
129
  http_client=DefaultAioHttpClient(),
126
130
  ) as client:
127
- response = await client.retrieve_server_info()
128
- print(response.environment)
131
+ response = await client.db.execute_query(
132
+ query="REPLACE_ME",
133
+ )
134
+ print(response.data)
129
135
 
130
136
 
131
137
  asyncio.run(main())
@@ -140,6 +146,24 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
140
146
 
141
147
  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
142
148
 
149
+ ## File uploads
150
+
151
+ Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
152
+
153
+ ```python
154
+ from pathlib import Path
155
+ from worqhat import Worqhat
156
+
157
+ client = Worqhat()
158
+
159
+ client.flows.trigger_with_file(
160
+ flow_id="f825ab82-371f-40cb-9bed-b325531ead4a",
161
+ file=Path("/path/to/file"),
162
+ )
163
+ ```
164
+
165
+ The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
166
+
143
167
  ## Handling errors
144
168
 
145
169
  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `worqhat.APIConnectionError` is raised.
@@ -156,7 +180,9 @@ from worqhat import Worqhat
156
180
  client = Worqhat()
157
181
 
158
182
  try:
159
- client.retrieve_server_info()
183
+ client.db.execute_query(
184
+ query="REPLACE_ME",
185
+ )
160
186
  except worqhat.APIConnectionError as e:
161
187
  print("The server could not be reached")
162
188
  print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -199,7 +225,9 @@ client = Worqhat(
199
225
  )
200
226
 
201
227
  # Or, configure per-request:
202
- client.with_options(max_retries=5).retrieve_server_info()
228
+ client.with_options(max_retries=5).db.execute_query(
229
+ query="REPLACE_ME",
230
+ )
203
231
  ```
204
232
 
205
233
  ### Timeouts
@@ -222,7 +250,9 @@ client = Worqhat(
222
250
  )
223
251
 
224
252
  # Override per-request:
225
- client.with_options(timeout=5.0).retrieve_server_info()
253
+ client.with_options(timeout=5.0).db.execute_query(
254
+ query="REPLACE_ME",
255
+ )
226
256
  ```
227
257
 
228
258
  On timeout, an `APITimeoutError` is thrown.
@@ -263,11 +293,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
263
293
  from worqhat import Worqhat
264
294
 
265
295
  client = Worqhat()
266
- response = client.with_raw_response.retrieve_server_info()
296
+ response = client.db.with_raw_response.execute_query(
297
+ query="REPLACE_ME",
298
+ )
267
299
  print(response.headers.get('X-My-Header'))
268
300
 
269
- client = response.parse() # get the object that `retrieve_server_info()` would have returned
270
- print(client.environment)
301
+ db = response.parse() # get the object that `db.execute_query()` would have returned
302
+ print(db.data)
271
303
  ```
272
304
 
273
305
  These methods return an [`APIResponse`](https://github.com/WorqHat/worqhat-python-sdk/tree/main/src/worqhat/_response.py) object.
@@ -281,7 +313,9 @@ The above interface eagerly reads the full response body when you make the reque
281
313
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
282
314
 
283
315
  ```python
284
- with client.with_streaming_response.retrieve_server_info() as response:
316
+ with client.db.with_streaming_response.execute_query(
317
+ query="REPLACE_ME",
318
+ ) as response:
285
319
  print(response.headers.get("X-My-Header"))
286
320
 
287
321
  for line in response.iter_lines():
@@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/).
11
11
 
12
12
  ## Documentation
13
13
 
14
- The REST API documentation can be found on [docs.worqhat.com](https://docs.worqhat.com). The full API of this library can be found in [api.md](api.md).
14
+ The REST API documentation can be found on [worqhat.com](https://worqhat.com/support). The full API of this library can be found in [api.md](api.md).
15
15
 
16
16
  ## Installation
17
17
 
@@ -32,8 +32,10 @@ client = Worqhat(
32
32
  api_key=os.environ.get("WORQHAT_API_KEY"), # This is the default and can be omitted
33
33
  )
34
34
 
35
- response = client.retrieve_server_info()
36
- print(response.environment)
35
+ response = client.db.execute_query(
36
+ query="REPLACE_ME",
37
+ )
38
+ print(response.data)
37
39
  ```
38
40
 
39
41
  While you can provide an `api_key` keyword argument,
@@ -56,8 +58,10 @@ client = AsyncWorqhat(
56
58
 
57
59
 
58
60
  async def main() -> None:
59
- response = await client.retrieve_server_info()
60
- print(response.environment)
61
+ response = await client.db.execute_query(
62
+ query="REPLACE_ME",
63
+ )
64
+ print(response.data)
61
65
 
62
66
 
63
67
  asyncio.run(main())
@@ -89,8 +93,10 @@ async def main() -> None:
89
93
  api_key="My API Key",
90
94
  http_client=DefaultAioHttpClient(),
91
95
  ) as client:
92
- response = await client.retrieve_server_info()
93
- print(response.environment)
96
+ response = await client.db.execute_query(
97
+ query="REPLACE_ME",
98
+ )
99
+ print(response.data)
94
100
 
95
101
 
96
102
  asyncio.run(main())
@@ -105,6 +111,24 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
105
111
 
106
112
  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
107
113
 
114
+ ## File uploads
115
+
116
+ Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
117
+
118
+ ```python
119
+ from pathlib import Path
120
+ from worqhat import Worqhat
121
+
122
+ client = Worqhat()
123
+
124
+ client.flows.trigger_with_file(
125
+ flow_id="f825ab82-371f-40cb-9bed-b325531ead4a",
126
+ file=Path("/path/to/file"),
127
+ )
128
+ ```
129
+
130
+ The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
131
+
108
132
  ## Handling errors
109
133
 
110
134
  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `worqhat.APIConnectionError` is raised.
@@ -121,7 +145,9 @@ from worqhat import Worqhat
121
145
  client = Worqhat()
122
146
 
123
147
  try:
124
- client.retrieve_server_info()
148
+ client.db.execute_query(
149
+ query="REPLACE_ME",
150
+ )
125
151
  except worqhat.APIConnectionError as e:
126
152
  print("The server could not be reached")
127
153
  print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -164,7 +190,9 @@ client = Worqhat(
164
190
  )
165
191
 
166
192
  # Or, configure per-request:
167
- client.with_options(max_retries=5).retrieve_server_info()
193
+ client.with_options(max_retries=5).db.execute_query(
194
+ query="REPLACE_ME",
195
+ )
168
196
  ```
169
197
 
170
198
  ### Timeouts
@@ -187,7 +215,9 @@ client = Worqhat(
187
215
  )
188
216
 
189
217
  # Override per-request:
190
- client.with_options(timeout=5.0).retrieve_server_info()
218
+ client.with_options(timeout=5.0).db.execute_query(
219
+ query="REPLACE_ME",
220
+ )
191
221
  ```
192
222
 
193
223
  On timeout, an `APITimeoutError` is thrown.
@@ -228,11 +258,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
228
258
  from worqhat import Worqhat
229
259
 
230
260
  client = Worqhat()
231
- response = client.with_raw_response.retrieve_server_info()
261
+ response = client.db.with_raw_response.execute_query(
262
+ query="REPLACE_ME",
263
+ )
232
264
  print(response.headers.get('X-My-Header'))
233
265
 
234
- client = response.parse() # get the object that `retrieve_server_info()` would have returned
235
- print(client.environment)
266
+ db = response.parse() # get the object that `db.execute_query()` would have returned
267
+ print(db.data)
236
268
  ```
237
269
 
238
270
  These methods return an [`APIResponse`](https://github.com/WorqHat/worqhat-python-sdk/tree/main/src/worqhat/_response.py) object.
@@ -246,7 +278,9 @@ The above interface eagerly reads the full response body when you make the reque
246
278
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
247
279
 
248
280
  ```python
249
- with client.with_streaming_response.retrieve_server_info() as response:
281
+ with client.db.with_streaming_response.execute_query(
282
+ query="REPLACE_ME",
283
+ ) as response:
250
284
  print(response.headers.get("X-My-Header"))
251
285
 
252
286
  for line in response.iter_lines():
worqhat-3.4.0/api.md ADDED
@@ -0,0 +1,63 @@
1
+ # Worqhat
2
+
3
+ Types:
4
+
5
+ ```python
6
+ from worqhat.types import GetServerInfoResponse
7
+ ```
8
+
9
+ Methods:
10
+
11
+ - <code title="get /">client.<a href="./src/worqhat/_client.py">get_server_info</a>() -> <a href="./src/worqhat/types/get_server_info_response.py">GetServerInfoResponse</a></code>
12
+
13
+ # DB
14
+
15
+ Types:
16
+
17
+ ```python
18
+ from worqhat.types import (
19
+ DBDeleteRecordsResponse,
20
+ DBExecuteQueryResponse,
21
+ DBInsertRecordResponse,
22
+ DBProcessNlQueryResponse,
23
+ DBUpdateRecordsResponse,
24
+ )
25
+ ```
26
+
27
+ Methods:
28
+
29
+ - <code title="delete /db/delete">client.db.<a href="./src/worqhat/resources/db.py">delete_records</a>(\*\*<a href="src/worqhat/types/db_delete_records_params.py">params</a>) -> <a href="./src/worqhat/types/db_delete_records_response.py">DBDeleteRecordsResponse</a></code>
30
+ - <code title="post /db/query">client.db.<a href="./src/worqhat/resources/db.py">execute_query</a>(\*\*<a href="src/worqhat/types/db_execute_query_params.py">params</a>) -> <a href="./src/worqhat/types/db_execute_query_response.py">DBExecuteQueryResponse</a></code>
31
+ - <code title="post /db/insert">client.db.<a href="./src/worqhat/resources/db.py">insert_record</a>(\*\*<a href="src/worqhat/types/db_insert_record_params.py">params</a>) -> <a href="./src/worqhat/types/db_insert_record_response.py">DBInsertRecordResponse</a></code>
32
+ - <code title="post /db/nl-query">client.db.<a href="./src/worqhat/resources/db.py">process_nl_query</a>(\*\*<a href="src/worqhat/types/db_process_nl_query_params.py">params</a>) -> <a href="./src/worqhat/types/db_process_nl_query_response.py">DBProcessNlQueryResponse</a></code>
33
+ - <code title="put /db/update">client.db.<a href="./src/worqhat/resources/db.py">update_records</a>(\*\*<a href="src/worqhat/types/db_update_records_params.py">params</a>) -> <a href="./src/worqhat/types/db_update_records_response.py">DBUpdateRecordsResponse</a></code>
34
+
35
+ # Health
36
+
37
+ Types:
38
+
39
+ ```python
40
+ from worqhat.types import HealthCheckResponse
41
+ ```
42
+
43
+ Methods:
44
+
45
+ - <code title="get /health">client.health.<a href="./src/worqhat/resources/health.py">check</a>() -> <a href="./src/worqhat/types/health_check_response.py">HealthCheckResponse</a></code>
46
+
47
+ # Flows
48
+
49
+ Types:
50
+
51
+ ```python
52
+ from worqhat.types import (
53
+ FlowGetMetricsResponse,
54
+ FlowTriggerWithFileResponse,
55
+ FlowTriggerWithPayloadResponse,
56
+ )
57
+ ```
58
+
59
+ Methods:
60
+
61
+ - <code title="get /flows/metrics">client.flows.<a href="./src/worqhat/resources/flows.py">get_metrics</a>(\*\*<a href="src/worqhat/types/flow_get_metrics_params.py">params</a>) -> <a href="./src/worqhat/types/flow_get_metrics_response.py">FlowGetMetricsResponse</a></code>
62
+ - <code title="post /flows/file/{flowId}">client.flows.<a href="./src/worqhat/resources/flows.py">trigger_with_file</a>(flow_id, \*\*<a href="src/worqhat/types/flow_trigger_with_file_params.py">params</a>) -> <a href="./src/worqhat/types/flow_trigger_with_file_response.py">FlowTriggerWithFileResponse</a></code>
63
+ - <code title="post /flows/trigger/{flowId}">client.flows.<a href="./src/worqhat/resources/flows.py">trigger_with_payload</a>(flow_id, \*\*<a href="src/worqhat/types/flow_trigger_with_payload_params.py">params</a>) -> <a href="./src/worqhat/types/flow_trigger_with_payload_response.py">FlowTriggerWithPayloadResponse</a></code>
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eux
4
+ mkdir -p dist
5
+ rye build --clean
6
+ rye publish --yes --token=$PYPI_TOKEN
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "worqhat"
3
- version = "3.1.0"
3
+ version = "3.4.0"
4
4
  description = "The official Python library for the worqhat API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -0,0 +1,135 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: true
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ aiohappyeyeballs==2.6.1
14
+ # via aiohttp
15
+ aiohttp==3.12.8
16
+ # via httpx-aiohttp
17
+ # via worqhat
18
+ aiosignal==1.3.2
19
+ # via aiohttp
20
+ annotated-types==0.6.0
21
+ # via pydantic
22
+ anyio==4.4.0
23
+ # via httpx
24
+ # via worqhat
25
+ argcomplete==3.1.2
26
+ # via nox
27
+ async-timeout==5.0.1
28
+ # via aiohttp
29
+ attrs==25.3.0
30
+ # via aiohttp
31
+ certifi==2023.7.22
32
+ # via httpcore
33
+ # via httpx
34
+ colorlog==6.7.0
35
+ # via nox
36
+ dirty-equals==0.6.0
37
+ distlib==0.3.7
38
+ # via virtualenv
39
+ distro==1.8.0
40
+ # via worqhat
41
+ exceptiongroup==1.2.2
42
+ # via anyio
43
+ # via pytest
44
+ execnet==2.1.1
45
+ # via pytest-xdist
46
+ filelock==3.12.4
47
+ # via virtualenv
48
+ frozenlist==1.6.2
49
+ # via aiohttp
50
+ # via aiosignal
51
+ h11==0.16.0
52
+ # via httpcore
53
+ httpcore==1.0.9
54
+ # via httpx
55
+ httpx==0.28.1
56
+ # via httpx-aiohttp
57
+ # via respx
58
+ # via worqhat
59
+ httpx-aiohttp==0.1.8
60
+ # via worqhat
61
+ idna==3.4
62
+ # via anyio
63
+ # via httpx
64
+ # via yarl
65
+ importlib-metadata==7.0.0
66
+ iniconfig==2.0.0
67
+ # via pytest
68
+ markdown-it-py==3.0.0
69
+ # via rich
70
+ mdurl==0.1.2
71
+ # via markdown-it-py
72
+ multidict==6.4.4
73
+ # via aiohttp
74
+ # via yarl
75
+ mypy==1.14.1
76
+ mypy-extensions==1.0.0
77
+ # via mypy
78
+ nest-asyncio==1.6.0
79
+ nodeenv==1.8.0
80
+ # via pyright
81
+ nox==2023.4.22
82
+ packaging==23.2
83
+ # via nox
84
+ # via pytest
85
+ platformdirs==3.11.0
86
+ # via virtualenv
87
+ pluggy==1.5.0
88
+ # via pytest
89
+ propcache==0.3.1
90
+ # via aiohttp
91
+ # via yarl
92
+ pydantic==2.10.3
93
+ # via worqhat
94
+ pydantic-core==2.27.1
95
+ # via pydantic
96
+ pygments==2.18.0
97
+ # via rich
98
+ pyright==1.1.399
99
+ pytest==8.3.3
100
+ # via pytest-asyncio
101
+ # via pytest-xdist
102
+ pytest-asyncio==0.24.0
103
+ pytest-xdist==3.7.0
104
+ python-dateutil==2.8.2
105
+ # via time-machine
106
+ pytz==2023.3.post1
107
+ # via dirty-equals
108
+ respx==0.22.0
109
+ rich==13.7.1
110
+ ruff==0.9.4
111
+ setuptools==68.2.2
112
+ # via nodeenv
113
+ six==1.16.0
114
+ # via python-dateutil
115
+ sniffio==1.3.0
116
+ # via anyio
117
+ # via worqhat
118
+ time-machine==2.9.0
119
+ tomli==2.0.2
120
+ # via mypy
121
+ # via pytest
122
+ typing-extensions==4.12.2
123
+ # via anyio
124
+ # via multidict
125
+ # via mypy
126
+ # via pydantic
127
+ # via pydantic-core
128
+ # via pyright
129
+ # via worqhat
130
+ virtualenv==20.24.5
131
+ # via nox
132
+ yarl==1.20.0
133
+ # via aiohttp
134
+ zipp==3.17.0
135
+ # via importlib-metadata
@@ -532,7 +532,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
532
532
  is_body_allowed = options.method.lower() != "get"
533
533
 
534
534
  if is_body_allowed:
535
- kwargs["json"] = json_data if is_given(json_data) else None
535
+ if isinstance(json_data, bytes):
536
+ kwargs["content"] = json_data
537
+ else:
538
+ kwargs["json"] = json_data if is_given(json_data) else None
536
539
  kwargs["files"] = files
537
540
  else:
538
541
  headers.pop("Content-Type", None)