raindrop-query 0.1.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 (80) hide show
  1. raindrop_query-0.1.0/PKG-INFO +526 -0
  2. raindrop_query-0.1.0/README-PYPI.md +513 -0
  3. raindrop_query-0.1.0/README.md +513 -0
  4. raindrop_query-0.1.0/pyproject.toml +54 -0
  5. raindrop_query-0.1.0/setup.cfg +4 -0
  6. raindrop_query-0.1.0/src/raindrop_query/__init__.py +17 -0
  7. raindrop_query-0.1.0/src/raindrop_query/_hooks/__init__.py +5 -0
  8. raindrop_query-0.1.0/src/raindrop_query/_hooks/registration.py +13 -0
  9. raindrop_query-0.1.0/src/raindrop_query/_hooks/sdkhooks.py +76 -0
  10. raindrop_query-0.1.0/src/raindrop_query/_hooks/types.py +112 -0
  11. raindrop_query-0.1.0/src/raindrop_query/_version.py +15 -0
  12. raindrop_query-0.1.0/src/raindrop_query/basesdk.py +388 -0
  13. raindrop_query-0.1.0/src/raindrop_query/conversations.py +418 -0
  14. raindrop_query-0.1.0/src/raindrop_query/errors/__init__.py +155 -0
  15. raindrop_query-0.1.0/src/raindrop_query/errors/conversations_getop.py +31 -0
  16. raindrop_query-0.1.0/src/raindrop_query/errors/conversations_listop.py +31 -0
  17. raindrop_query-0.1.0/src/raindrop_query/errors/events_facetsop.py +31 -0
  18. raindrop_query-0.1.0/src/raindrop_query/errors/events_getop.py +31 -0
  19. raindrop_query-0.1.0/src/raindrop_query/errors/events_listop.py +31 -0
  20. raindrop_query-0.1.0/src/raindrop_query/errors/events_searchop.py +31 -0
  21. raindrop_query-0.1.0/src/raindrop_query/errors/no_response_error.py +17 -0
  22. raindrop_query-0.1.0/src/raindrop_query/errors/raindropquerydefaulterror.py +40 -0
  23. raindrop_query-0.1.0/src/raindrop_query/errors/raindropqueryerror.py +30 -0
  24. raindrop_query-0.1.0/src/raindrop_query/errors/responsevalidationerror.py +27 -0
  25. raindrop_query-0.1.0/src/raindrop_query/errors/signal_groups_getop.py +31 -0
  26. raindrop_query-0.1.0/src/raindrop_query/errors/signal_groups_list_signalsop.py +33 -0
  27. raindrop_query-0.1.0/src/raindrop_query/errors/signal_groups_listop.py +31 -0
  28. raindrop_query-0.1.0/src/raindrop_query/errors/signals_getop.py +31 -0
  29. raindrop_query-0.1.0/src/raindrop_query/errors/signals_listop.py +31 -0
  30. raindrop_query-0.1.0/src/raindrop_query/errors/users_getop.py +31 -0
  31. raindrop_query-0.1.0/src/raindrop_query/errors/users_listop.py +31 -0
  32. raindrop_query-0.1.0/src/raindrop_query/events.py +1533 -0
  33. raindrop_query-0.1.0/src/raindrop_query/httpclient.py +125 -0
  34. raindrop_query-0.1.0/src/raindrop_query/models/__init__.py +978 -0
  35. raindrop_query-0.1.0/src/raindrop_query/models/conversations_getop.py +154 -0
  36. raindrop_query-0.1.0/src/raindrop_query/models/conversations_listop.py +324 -0
  37. raindrop_query-0.1.0/src/raindrop_query/models/events_countop.py +483 -0
  38. raindrop_query-0.1.0/src/raindrop_query/models/events_facetsop.py +185 -0
  39. raindrop_query-0.1.0/src/raindrop_query/models/events_getop.py +187 -0
  40. raindrop_query-0.1.0/src/raindrop_query/models/events_listop.py +683 -0
  41. raindrop_query-0.1.0/src/raindrop_query/models/events_searchop.py +302 -0
  42. raindrop_query-0.1.0/src/raindrop_query/models/events_timeseriesop.py +496 -0
  43. raindrop_query-0.1.0/src/raindrop_query/models/security.py +24 -0
  44. raindrop_query-0.1.0/src/raindrop_query/models/signal_groups_getop.py +143 -0
  45. raindrop_query-0.1.0/src/raindrop_query/models/signal_groups_list_signalsop.py +205 -0
  46. raindrop_query-0.1.0/src/raindrop_query/models/signal_groups_listop.py +206 -0
  47. raindrop_query-0.1.0/src/raindrop_query/models/signals_getop.py +137 -0
  48. raindrop_query-0.1.0/src/raindrop_query/models/signals_listop.py +200 -0
  49. raindrop_query-0.1.0/src/raindrop_query/models/users_getop.py +137 -0
  50. raindrop_query-0.1.0/src/raindrop_query/models/users_listop.py +428 -0
  51. raindrop_query-0.1.0/src/raindrop_query/py.typed +1 -0
  52. raindrop_query-0.1.0/src/raindrop_query/sdk.py +193 -0
  53. raindrop_query-0.1.0/src/raindrop_query/sdkconfiguration.py +49 -0
  54. raindrop_query-0.1.0/src/raindrop_query/signal_groups.py +598 -0
  55. raindrop_query-0.1.0/src/raindrop_query/signals.py +392 -0
  56. raindrop_query-0.1.0/src/raindrop_query/types/__init__.py +21 -0
  57. raindrop_query-0.1.0/src/raindrop_query/types/basemodel.py +77 -0
  58. raindrop_query-0.1.0/src/raindrop_query/users.py +438 -0
  59. raindrop_query-0.1.0/src/raindrop_query/utils/__init__.py +206 -0
  60. raindrop_query-0.1.0/src/raindrop_query/utils/annotations.py +79 -0
  61. raindrop_query-0.1.0/src/raindrop_query/utils/datetimes.py +23 -0
  62. raindrop_query-0.1.0/src/raindrop_query/utils/enums.py +134 -0
  63. raindrop_query-0.1.0/src/raindrop_query/utils/eventstreaming.py +248 -0
  64. raindrop_query-0.1.0/src/raindrop_query/utils/forms.py +234 -0
  65. raindrop_query-0.1.0/src/raindrop_query/utils/headers.py +136 -0
  66. raindrop_query-0.1.0/src/raindrop_query/utils/logger.py +22 -0
  67. raindrop_query-0.1.0/src/raindrop_query/utils/metadata.py +118 -0
  68. raindrop_query-0.1.0/src/raindrop_query/utils/queryparams.py +217 -0
  69. raindrop_query-0.1.0/src/raindrop_query/utils/requestbodies.py +66 -0
  70. raindrop_query-0.1.0/src/raindrop_query/utils/retries.py +281 -0
  71. raindrop_query-0.1.0/src/raindrop_query/utils/security.py +174 -0
  72. raindrop_query-0.1.0/src/raindrop_query/utils/serializers.py +229 -0
  73. raindrop_query-0.1.0/src/raindrop_query/utils/unmarshal_json_response.py +38 -0
  74. raindrop_query-0.1.0/src/raindrop_query/utils/url.py +155 -0
  75. raindrop_query-0.1.0/src/raindrop_query/utils/values.py +137 -0
  76. raindrop_query-0.1.0/src/raindrop_query.egg-info/PKG-INFO +526 -0
  77. raindrop_query-0.1.0/src/raindrop_query.egg-info/SOURCES.txt +78 -0
  78. raindrop_query-0.1.0/src/raindrop_query.egg-info/dependency_links.txt +1 -0
  79. raindrop_query-0.1.0/src/raindrop_query.egg-info/requires.txt +3 -0
  80. raindrop_query-0.1.0/src/raindrop_query.egg-info/top_level.txt +1 -0
@@ -0,0 +1,526 @@
1
+ Metadata-Version: 2.4
2
+ Name: raindrop-query
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for the Raindrop Query API
5
+ Author: Speakeasy
6
+ License: Apache-2.0
7
+ Project-URL: repository, https://github.com/raindrop-ai/query-sdk.git
8
+ Requires-Python: >=3.9.2
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: httpcore>=1.0.9
11
+ Requires-Dist: httpx>=0.28.1
12
+ Requires-Dist: pydantic>=2.11.2
13
+
14
+ # raindrop-query
15
+
16
+ Developer-friendly & type-safe Python SDK specifically catered to leverage *raindrop-query* API.
17
+
18
+ [![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=raindrop-query&utm_campaign=python)
19
+ [![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)
20
+
21
+
22
+ <br /><br />
23
+ > [!IMPORTANT]
24
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/raindrop/query). Delete this section before > publishing to a package manager.
25
+
26
+ <!-- Start Summary [summary] -->
27
+ ## Summary
28
+
29
+ Raindrop Query API (Beta): API for querying Signals, Events, Users, and Conversations data.
30
+ <!-- End Summary [summary] -->
31
+
32
+ <!-- Start Table of Contents [toc] -->
33
+ ## Table of Contents
34
+ <!-- $toc-max-depth=2 -->
35
+ * [raindrop-query](https://github.com/raindrop-ai/query-sdk/blob/master/python/#raindrop-query)
36
+ * [SDK Installation](https://github.com/raindrop-ai/query-sdk/blob/master/python/#sdk-installation)
37
+ * [IDE Support](https://github.com/raindrop-ai/query-sdk/blob/master/python/#ide-support)
38
+ * [SDK Example Usage](https://github.com/raindrop-ai/query-sdk/blob/master/python/#sdk-example-usage)
39
+ * [Authentication](https://github.com/raindrop-ai/query-sdk/blob/master/python/#authentication)
40
+ * [Available Resources and Operations](https://github.com/raindrop-ai/query-sdk/blob/master/python/#available-resources-and-operations)
41
+ * [Retries](https://github.com/raindrop-ai/query-sdk/blob/master/python/#retries)
42
+ * [Error Handling](https://github.com/raindrop-ai/query-sdk/blob/master/python/#error-handling)
43
+ * [Server Selection](https://github.com/raindrop-ai/query-sdk/blob/master/python/#server-selection)
44
+ * [Custom HTTP Client](https://github.com/raindrop-ai/query-sdk/blob/master/python/#custom-http-client)
45
+ * [Resource Management](https://github.com/raindrop-ai/query-sdk/blob/master/python/#resource-management)
46
+ * [Debugging](https://github.com/raindrop-ai/query-sdk/blob/master/python/#debugging)
47
+ * [Development](https://github.com/raindrop-ai/query-sdk/blob/master/python/#development)
48
+ * [Maturity](https://github.com/raindrop-ai/query-sdk/blob/master/python/#maturity)
49
+ * [Contributions](https://github.com/raindrop-ai/query-sdk/blob/master/python/#contributions)
50
+
51
+ <!-- End Table of Contents [toc] -->
52
+
53
+ <!-- Start SDK Installation [installation] -->
54
+ ## SDK Installation
55
+
56
+ > [!TIP]
57
+ > To finish publishing your SDK to PyPI you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
58
+
59
+
60
+ > [!NOTE]
61
+ > **Python version upgrade policy**
62
+ >
63
+ > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
64
+
65
+ The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
66
+
67
+ ### uv
68
+
69
+ *uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
70
+
71
+ ```bash
72
+ uv add git+https://github.com/raindrop-ai/query-sdk.git#subdirectory=python
73
+ ```
74
+
75
+ ### PIP
76
+
77
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
78
+
79
+ ```bash
80
+ pip install git+https://github.com/raindrop-ai/query-sdk.git#subdirectory=python
81
+ ```
82
+
83
+ ### Poetry
84
+
85
+ *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
86
+
87
+ ```bash
88
+ poetry add git+https://github.com/raindrop-ai/query-sdk.git#subdirectory=python
89
+ ```
90
+
91
+ ### Shell and script usage with `uv`
92
+
93
+ You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
94
+
95
+ ```shell
96
+ uvx --from raindrop-query python
97
+ ```
98
+
99
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
100
+
101
+ ```python
102
+ #!/usr/bin/env -S uv run --script
103
+ # /// script
104
+ # requires-python = ">=3.9"
105
+ # dependencies = [
106
+ # "raindrop-query",
107
+ # ]
108
+ # ///
109
+
110
+ from raindrop_query import RaindropQuery
111
+
112
+ sdk = RaindropQuery(
113
+ # SDK arguments
114
+ )
115
+
116
+ # Rest of script here...
117
+ ```
118
+
119
+ Once that is saved to a file, you can run it with `uv run script.py` where
120
+ `script.py` can be replaced with the actual file name.
121
+ <!-- End SDK Installation [installation] -->
122
+
123
+ <!-- Start IDE Support [idesupport] -->
124
+ ## IDE Support
125
+
126
+ ### PyCharm
127
+
128
+ Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
129
+
130
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
131
+ <!-- End IDE Support [idesupport] -->
132
+
133
+ <!-- Start SDK Example Usage [usage] -->
134
+ ## SDK Example Usage
135
+
136
+ ### Example
137
+
138
+ ```python
139
+ # Synchronous Example
140
+ from raindrop_query import RaindropQuery
141
+
142
+
143
+ with RaindropQuery(
144
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
145
+ ) as rq_client:
146
+
147
+ res = rq_client.signals.list(limit=50, order_by="-timestamp")
148
+
149
+ # Handle response
150
+ print(res)
151
+ ```
152
+
153
+ </br>
154
+
155
+ The same SDK client can also be used to make asynchronous requests by importing asyncio.
156
+
157
+ ```python
158
+ # Asynchronous Example
159
+ import asyncio
160
+ from raindrop_query import RaindropQuery
161
+
162
+ async def main():
163
+
164
+ async with RaindropQuery(
165
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
166
+ ) as rq_client:
167
+
168
+ res = await rq_client.signals.list_async(limit=50, order_by="-timestamp")
169
+
170
+ # Handle response
171
+ print(res)
172
+
173
+ asyncio.run(main())
174
+ ```
175
+ <!-- End SDK Example Usage [usage] -->
176
+
177
+ <!-- Start Authentication [security] -->
178
+ ## Authentication
179
+
180
+ ### Per-Client Security Schemes
181
+
182
+ This SDK supports the following security scheme globally:
183
+
184
+ | Name | Type | Scheme |
185
+ | --------- | ---- | ----------- |
186
+ | `api_key` | http | HTTP Bearer |
187
+
188
+ To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example:
189
+ ```python
190
+ from raindrop_query import RaindropQuery
191
+
192
+
193
+ with RaindropQuery(
194
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
195
+ ) as rq_client:
196
+
197
+ res = rq_client.signals.list(limit=50, order_by="-timestamp")
198
+
199
+ # Handle response
200
+ print(res)
201
+
202
+ ```
203
+ <!-- End Authentication [security] -->
204
+
205
+ <!-- Start Available Resources and Operations [operations] -->
206
+ ## Available Resources and Operations
207
+
208
+ <details open>
209
+ <summary>Available methods</summary>
210
+
211
+ ### [Conversations](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/conversations/README.md)
212
+
213
+ * [list](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/conversations/README.md#list) - List conversations
214
+ * [get](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/conversations/README.md#get) - Get conversation details
215
+
216
+ ### [Events](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md)
217
+
218
+ * [list](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#list) - List events
219
+ * [search](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#search) - Search events (GET)
220
+ * [count](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#count) - Count events
221
+ * [timeseries](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#timeseries) - Get event timeseries
222
+ * [facets](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#facets) - Get event facets
223
+ * [get](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/events/README.md#get) - Get event details
224
+
225
+ ### [SignalGroups](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signalgroups/README.md)
226
+
227
+ * [list](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signalgroups/README.md#list) - List all signal groups
228
+ * [get](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signalgroups/README.md#get) - Get signal group details
229
+ * [list_signals](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signalgroups/README.md#list_signals) - List signals in group
230
+
231
+ ### [Signals](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signals/README.md)
232
+
233
+ * [list](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signals/README.md#list) - List all signals
234
+ * [get](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/signals/README.md#get) - Get signal details
235
+
236
+ ### [Users](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/users/README.md)
237
+
238
+ * [list](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/users/README.md#list) - List users
239
+ * [get](https://github.com/raindrop-ai/query-sdk/blob/master/python/docs/sdks/users/README.md#get) - Get user details
240
+
241
+ </details>
242
+ <!-- End Available Resources and Operations [operations] -->
243
+
244
+ <!-- Start Retries [retries] -->
245
+ ## Retries
246
+
247
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
248
+
249
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
250
+ ```python
251
+ from raindrop_query import RaindropQuery
252
+ from raindrop_query.utils import BackoffStrategy, RetryConfig
253
+
254
+
255
+ with RaindropQuery(
256
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
257
+ ) as rq_client:
258
+
259
+ res = rq_client.signals.list(limit=50, order_by="-timestamp",
260
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
261
+
262
+ # Handle response
263
+ print(res)
264
+
265
+ ```
266
+
267
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
268
+ ```python
269
+ from raindrop_query import RaindropQuery
270
+ from raindrop_query.utils import BackoffStrategy, RetryConfig
271
+
272
+
273
+ with RaindropQuery(
274
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
275
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
276
+ ) as rq_client:
277
+
278
+ res = rq_client.signals.list(limit=50, order_by="-timestamp")
279
+
280
+ # Handle response
281
+ print(res)
282
+
283
+ ```
284
+ <!-- End Retries [retries] -->
285
+
286
+ <!-- Start Error Handling [errors] -->
287
+ ## Error Handling
288
+
289
+ [`RaindropQueryError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/raindropqueryerror.py) is the base class for all HTTP error responses. It has the following properties:
290
+
291
+ | Property | Type | Description |
292
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
293
+ | `err.message` | `str` | Error message |
294
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
295
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
296
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
297
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
298
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/raindrop-ai/query-sdk/blob/master/python/#error-classes). |
299
+
300
+ ### Example
301
+ ```python
302
+ from raindrop_query import RaindropQuery, errors
303
+
304
+
305
+ with RaindropQuery(
306
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
307
+ ) as rq_client:
308
+ res = None
309
+ try:
310
+
311
+ res = rq_client.signals.list(limit=50, order_by="-timestamp")
312
+
313
+ # Handle response
314
+ print(res)
315
+
316
+
317
+ except errors.RaindropQueryError as e:
318
+ # The base class for HTTP error responses
319
+ print(e.message)
320
+ print(e.status_code)
321
+ print(e.body)
322
+ print(e.headers)
323
+ print(e.raw_response)
324
+
325
+ # Depending on the method different errors may be thrown
326
+ if isinstance(e, errors.SignalsListUnauthorizedError):
327
+ print(e.data.error) # models.SignalsListError
328
+ ```
329
+
330
+ ### Error Classes
331
+ **Primary error:**
332
+ * [`RaindropQueryError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/raindropqueryerror.py): The base class for HTTP error responses.
333
+
334
+ <details><summary>Less common errors (18)</summary>
335
+
336
+ <br />
337
+
338
+ **Network errors:**
339
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
340
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
341
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
342
+
343
+
344
+ **Inherit from [`RaindropQueryError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/raindropqueryerror.py)**:
345
+ * [`EventsSearchBadRequestError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/eventssearchbadrequesterror.py): Invalid request (e.g., date range exceeds maximum). Status code `400`. Applicable to 1 of 15 methods.*
346
+ * [`EventsFacetsBadRequestError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/eventsfacetsbadrequesterror.py): Invalid field name. Status code `400`. Applicable to 1 of 15 methods.*
347
+ * [`SignalsListUnauthorizedError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/signalslistunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 15 methods.*
348
+ * [`SignalGroupsListUnauthorizedError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/signalgroupslistunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 15 methods.*
349
+ * [`EventsListUnauthorizedError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/eventslistunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 15 methods.*
350
+ * [`UsersListUnauthorizedError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/userslistunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 15 methods.*
351
+ * [`ConversationsListUnauthorizedError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/conversationslistunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 15 methods.*
352
+ * [`SignalsGetNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/signalsgetnotfounderror.py): Signal not found. Status code `404`. Applicable to 1 of 15 methods.*
353
+ * [`SignalGroupsGetNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/signalgroupsgetnotfounderror.py): Signal group not found. Status code `404`. Applicable to 1 of 15 methods.*
354
+ * [`SignalGroupsListSignalsNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/signalgroupslistsignalsnotfounderror.py): Signal group not found. Status code `404`. Applicable to 1 of 15 methods.*
355
+ * [`EventsGetNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/eventsgetnotfounderror.py): Event not found. Status code `404`. Applicable to 1 of 15 methods.*
356
+ * [`UsersGetNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/usersgetnotfounderror.py): User not found. Status code `404`. Applicable to 1 of 15 methods.*
357
+ * [`ConversationsGetNotFoundError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/conversationsgetnotfounderror.py): Conversation not found. Status code `404`. Applicable to 1 of 15 methods.*
358
+ * [`ResponseValidationError`](https://github.com/raindrop-ai/query-sdk/blob/master/python/./src/raindrop_query/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
359
+
360
+ </details>
361
+
362
+ \* Check [the method documentation](https://github.com/raindrop-ai/query-sdk/blob/master/python/#available-resources-and-operations) to see if the error is applicable.
363
+ <!-- End Error Handling [errors] -->
364
+
365
+ <!-- Start Server Selection [server] -->
366
+ ## Server Selection
367
+
368
+ ### Override Server URL Per-Client
369
+
370
+ The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
371
+ ```python
372
+ from raindrop_query import RaindropQuery
373
+
374
+
375
+ with RaindropQuery(
376
+ server_url="https://query.raindrop.ai",
377
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
378
+ ) as rq_client:
379
+
380
+ res = rq_client.signals.list(limit=50, order_by="-timestamp")
381
+
382
+ # Handle response
383
+ print(res)
384
+
385
+ ```
386
+ <!-- End Server Selection [server] -->
387
+
388
+ <!-- Start Custom HTTP Client [http-client] -->
389
+ ## Custom HTTP Client
390
+
391
+ The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
392
+ Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
393
+ This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
394
+
395
+ For example, you could specify a header for every request that this sdk makes as follows:
396
+ ```python
397
+ from raindrop_query import RaindropQuery
398
+ import httpx
399
+
400
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
401
+ s = RaindropQuery(client=http_client)
402
+ ```
403
+
404
+ or you could wrap the client with your own custom logic:
405
+ ```python
406
+ from raindrop_query import RaindropQuery
407
+ from raindrop_query.httpclient import AsyncHttpClient
408
+ import httpx
409
+
410
+ class CustomClient(AsyncHttpClient):
411
+ client: AsyncHttpClient
412
+
413
+ def __init__(self, client: AsyncHttpClient):
414
+ self.client = client
415
+
416
+ async def send(
417
+ self,
418
+ request: httpx.Request,
419
+ *,
420
+ stream: bool = False,
421
+ auth: Union[
422
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
423
+ ] = httpx.USE_CLIENT_DEFAULT,
424
+ follow_redirects: Union[
425
+ bool, httpx._client.UseClientDefault
426
+ ] = httpx.USE_CLIENT_DEFAULT,
427
+ ) -> httpx.Response:
428
+ request.headers["Client-Level-Header"] = "added by client"
429
+
430
+ return await self.client.send(
431
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
432
+ )
433
+
434
+ def build_request(
435
+ self,
436
+ method: str,
437
+ url: httpx._types.URLTypes,
438
+ *,
439
+ content: Optional[httpx._types.RequestContent] = None,
440
+ data: Optional[httpx._types.RequestData] = None,
441
+ files: Optional[httpx._types.RequestFiles] = None,
442
+ json: Optional[Any] = None,
443
+ params: Optional[httpx._types.QueryParamTypes] = None,
444
+ headers: Optional[httpx._types.HeaderTypes] = None,
445
+ cookies: Optional[httpx._types.CookieTypes] = None,
446
+ timeout: Union[
447
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
448
+ ] = httpx.USE_CLIENT_DEFAULT,
449
+ extensions: Optional[httpx._types.RequestExtensions] = None,
450
+ ) -> httpx.Request:
451
+ return self.client.build_request(
452
+ method,
453
+ url,
454
+ content=content,
455
+ data=data,
456
+ files=files,
457
+ json=json,
458
+ params=params,
459
+ headers=headers,
460
+ cookies=cookies,
461
+ timeout=timeout,
462
+ extensions=extensions,
463
+ )
464
+
465
+ s = RaindropQuery(async_client=CustomClient(httpx.AsyncClient()))
466
+ ```
467
+ <!-- End Custom HTTP Client [http-client] -->
468
+
469
+ <!-- Start Resource Management [resource-management] -->
470
+ ## Resource Management
471
+
472
+ The `RaindropQuery` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
473
+
474
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
475
+
476
+ ```python
477
+ from raindrop_query import RaindropQuery
478
+ def main():
479
+
480
+ with RaindropQuery(
481
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
482
+ ) as rq_client:
483
+ # Rest of application here...
484
+
485
+
486
+ # Or when using async:
487
+ async def amain():
488
+
489
+ async with RaindropQuery(
490
+ api_key="<YOUR_BEARER_TOKEN_HERE>",
491
+ ) as rq_client:
492
+ # Rest of application here...
493
+ ```
494
+ <!-- End Resource Management [resource-management] -->
495
+
496
+ <!-- Start Debugging [debug] -->
497
+ ## Debugging
498
+
499
+ You can setup your SDK to emit debug logs for SDK requests and responses.
500
+
501
+ You can pass your own logger class directly into your SDK.
502
+ ```python
503
+ from raindrop_query import RaindropQuery
504
+ import logging
505
+
506
+ logging.basicConfig(level=logging.DEBUG)
507
+ s = RaindropQuery(debug_logger=logging.getLogger("raindrop_query"))
508
+ ```
509
+ <!-- End Debugging [debug] -->
510
+
511
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
512
+
513
+ # Development
514
+
515
+ ## Maturity
516
+
517
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
518
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
519
+ looking for the latest version.
520
+
521
+ ## Contributions
522
+
523
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
524
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
525
+
526
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=raindrop-query&utm_campaign=python)