worqhat 3.1.0__py3-none-any.whl → 3.4.0__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 (30) hide show
  1. worqhat/_base_client.py +4 -1
  2. worqhat/_client.py +24 -16
  3. worqhat/_files.py +5 -5
  4. worqhat/_version.py +1 -1
  5. worqhat/resources/__init__.py +14 -0
  6. worqhat/resources/db.py +593 -0
  7. worqhat/resources/flows.py +235 -21
  8. worqhat/types/__init__.py +17 -3
  9. worqhat/types/db_delete_records_params.py +15 -0
  10. worqhat/types/db_delete_records_response.py +18 -0
  11. worqhat/types/db_execute_query_params.py +12 -0
  12. worqhat/types/db_execute_query_response.py +21 -0
  13. worqhat/types/db_insert_record_params.py +15 -0
  14. worqhat/types/db_insert_record_response.py +15 -0
  15. worqhat/types/db_process_nl_query_params.py +15 -0
  16. worqhat/types/db_process_nl_query_response.py +18 -0
  17. worqhat/types/db_update_records_params.py +18 -0
  18. worqhat/types/db_update_records_response.py +18 -0
  19. worqhat/types/{flow_retrieve_metrics_params.py → flow_get_metrics_params.py} +2 -2
  20. worqhat/types/{flow_retrieve_metrics_response.py → flow_get_metrics_response.py} +2 -2
  21. worqhat/types/flow_trigger_with_file_params.py +17 -0
  22. worqhat/types/flow_trigger_with_file_response.py +18 -0
  23. worqhat/types/flow_trigger_with_payload_params.py +12 -0
  24. worqhat/types/flow_trigger_with_payload_response.py +20 -0
  25. worqhat/types/{retrieve_server_info_response.py → get_server_info_response.py} +2 -2
  26. {worqhat-3.1.0.dist-info → worqhat-3.4.0.dist-info}/METADATA +49 -15
  27. worqhat-3.4.0.dist-info/RECORD +53 -0
  28. worqhat-3.1.0.dist-info/RECORD +0 -38
  29. {worqhat-3.1.0.dist-info → worqhat-3.4.0.dist-info}/WHEEL +0 -0
  30. {worqhat-3.1.0.dist-info → worqhat-3.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -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():
@@ -0,0 +1,53 @@
1
+ worqhat/__init__.py,sha256=NXlcxKw_bHh9zK2KgmvBdq24kz1g8XpXEGEZTEzOqjk,2587
2
+ worqhat/_base_client.py,sha256=1daYytjl3Svekdj0cxAW5DtghyOupUBvEp6gllE6avk,67036
3
+ worqhat/_client.py,sha256=b3PFx-cxWshWXpjJKXQh0Qv0QjTDnlc8m4fV339NI9Q,18182
4
+ worqhat/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
+ worqhat/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
+ worqhat/_exceptions.py,sha256=n2QtRwhErTAw2JJQ8Vt95ZlTeJvve2qXF8B1Z6M_7Ao,3222
7
+ worqhat/_files.py,sha256=Bmgx2fwiLeMSXBhC1tUenHcA1jqisBYZ5vPx9JwCc_w,3618
8
+ worqhat/_models.py,sha256=KvjsMfb88XZlFUKVoOxr8OyDj47MhoH2OKqWNEbBhk4,30010
9
+ worqhat/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
+ worqhat/_resource.py,sha256=2r0Ilj0AtogNG1TdsG6biEPWD5Ihgf1hOE51PwMEpyQ,1106
11
+ worqhat/_response.py,sha256=NBeCvMH3I_Zr6-Gp_8aE-S7TtNphvnw_gTlK53-lew0,28794
12
+ worqhat/_streaming.py,sha256=h3n2sOPN_iuD2DUno9BKZt0wT_F7GRZHcotRI5yuI0s,10104
13
+ worqhat/_types.py,sha256=RLnhzVhf9Dvl-6kTVf8TKfUOc0O9QR6J1A0se5vLcXA,6198
14
+ worqhat/_version.py,sha256=_5R1spKfllfAFZxnCBu1Bv5yeujmQhQsTQdCOLIOgBI,159
15
+ worqhat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ worqhat/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
+ worqhat/_utils/_logs.py,sha256=cb3jsbICK0cXrlqMRi4y96MiJuqk5_rQy3ujWtoZTJU,777
18
+ worqhat/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
19
+ worqhat/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
+ worqhat/_utils/_resources_proxy.py,sha256=KNhJsT2AQfFi4M_mmRtS0WAOH1Mq1ys8fLBhZfTKK-o,594
21
+ worqhat/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
22
+ worqhat/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
23
+ worqhat/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
24
+ worqhat/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
25
+ worqhat/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
+ worqhat/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
+ worqhat/resources/__init__.py,sha256=obTcrlI18jA4Pdccd9PQSXI7ZVOpjjEMY-oQJMrvcdY,1387
28
+ worqhat/resources/db.py,sha256=OM-HoXMaW8GFWwKJ5GXXY-BkwZaHbToh47QGrNk5Tb4,21503
29
+ worqhat/resources/flows.py,sha256=tHPctWECqV3oZGnHpF2mLESlJLXQSbWHpoONNC_U_A0,17514
30
+ worqhat/resources/health.py,sha256=Pfe7CiktH5BezkPmbEZsLhGqnl9MmQkMbt6DUaIbWUw,5127
31
+ worqhat/types/__init__.py,sha256=0eTtenEe0WsTWHV0JQ_AtxgpQqOKaAYxtwK6uRI38SA,1754
32
+ worqhat/types/db_delete_records_params.py,sha256=-NMisgux-vKvC59wOcF6HqYIvq33yFJJwT7uX5iywNI,382
33
+ worqhat/types/db_delete_records_response.py,sha256=zYQKUyewsmgDKY55CWywtO03EaMEO03Oc2JXDjRHtew,417
34
+ worqhat/types/db_execute_query_params.py,sha256=6JYtxSiFIYRJkCqxf-WheiVdPHynqOBxLE1Jtj3pPJ4,319
35
+ worqhat/types/db_execute_query_response.py,sha256=dd2ffeB-qkeTjXes6qtoLY_Z95-72AJ-KV5ZGc6Oq1s,549
36
+ worqhat/types/db_insert_record_params.py,sha256=s31eu1ELw-WTmC-ekBYOlS69R31FezPdIPGrBgl1hTQ,377
37
+ worqhat/types/db_insert_record_response.py,sha256=062aPrGmMzD63qbQS-jA2a6pRubzyEZSE_MgFqAkr9I,334
38
+ worqhat/types/db_process_nl_query_params.py,sha256=w8ILeHhTuqmQEs2k3J_G5_DHG_KrAyxX6sQY0HDppMI,395
39
+ worqhat/types/db_process_nl_query_response.py,sha256=sChHgVlQ9fzFDLwcycX2oZhkmpb-3wCm_YFXRvDLZQU,415
40
+ worqhat/types/db_update_records_params.py,sha256=-bVb7Dw5zYV-Gmgqzv6M16Ky9fAdBaXvjZjbCr7GOWc,430
41
+ worqhat/types/db_update_records_response.py,sha256=OLaAvsGA8wm_7XTg4GCXGjWgfpVfv5ufNp2gGG12gkI,417
42
+ worqhat/types/flow_get_metrics_params.py,sha256=x4SgBnhjUDIabDVd3f3_wVGldHSLelUSSM_AoxpglTs,768
43
+ worqhat/types/flow_get_metrics_response.py,sha256=xk4-y22nz_54QydhCRFYT-wONKaoSmjJSr-bT88r-b4,1287
44
+ worqhat/types/flow_trigger_with_file_params.py,sha256=E5u-840gLHNpM5DIpx6is_usrMgSiEu_OXZuS6-7D_A,414
45
+ worqhat/types/flow_trigger_with_file_response.py,sha256=xa3qZSBwa8eJddqlGJrwd9WO-hPw1k9NJr3Yrr2EUzk,433
46
+ worqhat/types/flow_trigger_with_payload_params.py,sha256=ydt-UkcKgRk2JDS538_IH5afr_gZxUf9OXy-BgjFhoM,341
47
+ worqhat/types/flow_trigger_with_payload_response.py,sha256=XT-6VEfTbpM3o098AATogw9s-X60gsd18b4T_xOiW60,479
48
+ worqhat/types/get_server_info_response.py,sha256=Ev88Yr-DGVx00hluVKMnY4xq-VluFvcQ6z08XZTPcCE,332
49
+ worqhat/types/health_check_response.py,sha256=29tvzgqsy6wVfFwVunK5ouzSYeZGEUnQQuQpAQGsoxI,885
50
+ worqhat-3.4.0.dist-info/METADATA,sha256=rqEzeBo4J3PhSVABwIMAMc7iauL8NXFoh6LlbFsyyTs,14325
51
+ worqhat-3.4.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
52
+ worqhat-3.4.0.dist-info/licenses/LICENSE,sha256=UwMftLIOitTJWtJ9bowByxdt9ZSFqmmb43oQosW5xiU,11337
53
+ worqhat-3.4.0.dist-info/RECORD,,
@@ -1,38 +0,0 @@
1
- worqhat/__init__.py,sha256=NXlcxKw_bHh9zK2KgmvBdq24kz1g8XpXEGEZTEzOqjk,2587
2
- worqhat/_base_client.py,sha256=tPQTKbWMDP3s0OiQuHMO3lAM5taEIz1rEOgbR_GTNoo,66923
3
- worqhat/_client.py,sha256=xymCNN1MgTbmNGgYGSBe3V8ZYuB47BlSDyZOF2vIO5U,17874
4
- worqhat/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
- worqhat/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
- worqhat/_exceptions.py,sha256=n2QtRwhErTAw2JJQ8Vt95ZlTeJvve2qXF8B1Z6M_7Ao,3222
7
- worqhat/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- worqhat/_models.py,sha256=KvjsMfb88XZlFUKVoOxr8OyDj47MhoH2OKqWNEbBhk4,30010
9
- worqhat/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
- worqhat/_resource.py,sha256=2r0Ilj0AtogNG1TdsG6biEPWD5Ihgf1hOE51PwMEpyQ,1106
11
- worqhat/_response.py,sha256=NBeCvMH3I_Zr6-Gp_8aE-S7TtNphvnw_gTlK53-lew0,28794
12
- worqhat/_streaming.py,sha256=h3n2sOPN_iuD2DUno9BKZt0wT_F7GRZHcotRI5yuI0s,10104
13
- worqhat/_types.py,sha256=RLnhzVhf9Dvl-6kTVf8TKfUOc0O9QR6J1A0se5vLcXA,6198
14
- worqhat/_version.py,sha256=nf-tOoE6_ztTDueSgnXmjQR7o7uaeIrEjg0hii0srGA,159
15
- worqhat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- worqhat/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
- worqhat/_utils/_logs.py,sha256=cb3jsbICK0cXrlqMRi4y96MiJuqk5_rQy3ujWtoZTJU,777
18
- worqhat/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
19
- worqhat/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
- worqhat/_utils/_resources_proxy.py,sha256=KNhJsT2AQfFi4M_mmRtS0WAOH1Mq1ys8fLBhZfTKK-o,594
21
- worqhat/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
22
- worqhat/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
23
- worqhat/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
24
- worqhat/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
25
- worqhat/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
- worqhat/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
- worqhat/resources/__init__.py,sha256=-XQmzr7q0bJW7cL4aopqosNOysUCxrJ0-pttbRVqL3A,989
28
- worqhat/resources/flows.py,sha256=jCzmxhZ8diuKubQaHE_mCnC1GYy7fhP66cvNHBUReUI,8211
29
- worqhat/resources/health.py,sha256=Pfe7CiktH5BezkPmbEZsLhGqnl9MmQkMbt6DUaIbWUw,5127
30
- worqhat/types/__init__.py,sha256=iV5rCndpqaAoydEG1QaUns5GfUrL7dXEUud2XFFWN-g,501
31
- worqhat/types/flow_retrieve_metrics_params.py,sha256=QMdN5LYYNSOXMBWLVLV0vMFLXIyvUVXNnLzjVFu_gTc,778
32
- worqhat/types/flow_retrieve_metrics_response.py,sha256=GajGYlbav9SVM0jF8RGzaHICtt6OIDlfid1sIP1oY0Q,1297
33
- worqhat/types/health_check_response.py,sha256=29tvzgqsy6wVfFwVunK5ouzSYeZGEUnQQuQpAQGsoxI,885
34
- worqhat/types/retrieve_server_info_response.py,sha256=9NDQ1MOKfU02tTlMcigQbjgUogqzrjmhmPir-77ftFY,342
35
- worqhat-3.1.0.dist-info/METADATA,sha256=ZRmy6MijBGF-AqosN6WhfjQtUbE-BT-52dtcNEu4Onk,13531
36
- worqhat-3.1.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
37
- worqhat-3.1.0.dist-info/licenses/LICENSE,sha256=UwMftLIOitTJWtJ9bowByxdt9ZSFqmmb43oQosW5xiU,11337
38
- worqhat-3.1.0.dist-info/RECORD,,