lambdadb 0.1.2__tar.gz → 0.2.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.
Potentially problematic release.
This version of lambdadb might be problematic. Click here for more details.
- {lambdadb-0.1.2 → lambdadb-0.2.0}/PKG-INFO +79 -106
- {lambdadb-0.1.2 → lambdadb-0.2.0}/README-PYPI.md +76 -104
- {lambdadb-0.1.2 → lambdadb-0.2.0}/pyproject.toml +5 -1
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/_hooks/__init__.py +0 -1
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/_hooks/sdkhooks.py +4 -6
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/_hooks/types.py +8 -2
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/_version.py +4 -4
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/basesdk.py +12 -20
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/collections.py +12 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/docs.py +10 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/__init__.py +0 -87
- lambdadb-0.2.0/src/lambdadb/projects.py +17 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/sdk.py +2 -7
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/sdkconfiguration.py +0 -7
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/forms.py +49 -28
- lambdadb-0.1.2/src/lambdadb/models/createprojectop.py +0 -39
- lambdadb-0.1.2/src/lambdadb/models/deleteprojectop.py +0 -52
- lambdadb-0.1.2/src/lambdadb/models/getprojectop.py +0 -39
- lambdadb-0.1.2/src/lambdadb/models/listprojectsop.py +0 -38
- lambdadb-0.1.2/src/lambdadb/models/projectresponse.py +0 -38
- lambdadb-0.1.2/src/lambdadb/models/updateprojectop.py +0 -58
- lambdadb-0.1.2/src/lambdadb/projects.py +0 -1228
- {lambdadb-0.1.2 → lambdadb-0.2.0}/LICENSE +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/py.typed +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/__init__.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/_hooks/registration.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/__init__.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/apierror.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/badrequest_error.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/internalservererror.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/resourcealreadyexists_error.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/resourcenotfound_error.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/toomanyrequests_error.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/errors/unauthenticated_error.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/httpclient.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/bulkupsertdocsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/collectionresponse.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/createcollectionop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/deletecollectionop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/deletedocsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/fetchdocsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/getbulkupsertdocsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/getcollectionop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/indexconfigs_union.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/listcollectionsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/querycollectionop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/security.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/status.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/updatecollectionop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/models/upsertdocsop.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/py.typed +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/types/__init__.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/types/basemodel.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/__init__.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/annotations.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/datetimes.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/enums.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/eventstreaming.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/headers.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/logger.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/metadata.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/queryparams.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/requestbodies.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/retries.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/security.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/serializers.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/url.py +0 -0
- {lambdadb-0.1.2 → lambdadb-0.2.0}/src/lambdadb/utils/values.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: lambdadb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
|
5
5
|
Author: Speakeasy
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -9,13 +9,15 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Requires-Dist: httpcore (>=1.0.9)
|
|
12
13
|
Requires-Dist: httpx (>=0.28.1)
|
|
13
14
|
Requires-Dist: pydantic (>=2.11.2)
|
|
15
|
+
Project-URL: Repository, https://github.com/lambdadb/lambdadb-python-client.git
|
|
14
16
|
Description-Content-Type: text/markdown
|
|
15
17
|
|
|
16
|
-
#
|
|
18
|
+
# LambdaDB Python SDK
|
|
17
19
|
|
|
18
|
-
Developer-friendly & type-safe Python SDK specifically catered to leverage *
|
|
20
|
+
Developer-friendly & type-safe Python SDK specifically catered to leverage *LambdaDB* API.
|
|
19
21
|
|
|
20
22
|
<div align="left">
|
|
21
23
|
<a href="https://www.speakeasy.com/?utm_source=lambdadb&utm_campaign=python"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
|
|
@@ -24,11 +26,6 @@ Developer-friendly & type-safe Python SDK specifically catered to leverage *lamb
|
|
|
24
26
|
</a>
|
|
25
27
|
</div>
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
<br /><br />
|
|
29
|
-
> [!IMPORTANT]
|
|
30
|
-
> 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/lambdadb/lambdadb-python). Delete this section before > publishing to a package manager.
|
|
31
|
-
|
|
32
29
|
<!-- Start Summary [summary] -->
|
|
33
30
|
## Summary
|
|
34
31
|
|
|
@@ -38,31 +35,27 @@ LambdaDB API: LambdaDB Open API Spec
|
|
|
38
35
|
<!-- Start Table of Contents [toc] -->
|
|
39
36
|
## Table of Contents
|
|
40
37
|
<!-- $toc-max-depth=2 -->
|
|
41
|
-
* [
|
|
42
|
-
* [SDK Installation](
|
|
43
|
-
* [IDE Support](
|
|
44
|
-
* [SDK Example Usage](
|
|
45
|
-
* [Authentication](
|
|
46
|
-
* [Available Resources and Operations](
|
|
47
|
-
* [Retries](
|
|
48
|
-
* [Error Handling](
|
|
49
|
-
* [Server Selection](
|
|
50
|
-
* [Custom HTTP Client](
|
|
51
|
-
* [Resource Management](
|
|
52
|
-
* [Debugging](
|
|
53
|
-
* [Development](
|
|
54
|
-
* [Maturity](
|
|
55
|
-
* [Contributions](
|
|
38
|
+
* [LambdaDB Python SDK](https://github.com/lambdadb/lambdadb-python-client/blob/master/#lambdadb-python-sdk)
|
|
39
|
+
* [SDK Installation](https://github.com/lambdadb/lambdadb-python-client/blob/master/#sdk-installation)
|
|
40
|
+
* [IDE Support](https://github.com/lambdadb/lambdadb-python-client/blob/master/#ide-support)
|
|
41
|
+
* [SDK Example Usage](https://github.com/lambdadb/lambdadb-python-client/blob/master/#sdk-example-usage)
|
|
42
|
+
* [Authentication](https://github.com/lambdadb/lambdadb-python-client/blob/master/#authentication)
|
|
43
|
+
* [Available Resources and Operations](https://github.com/lambdadb/lambdadb-python-client/blob/master/#available-resources-and-operations)
|
|
44
|
+
* [Retries](https://github.com/lambdadb/lambdadb-python-client/blob/master/#retries)
|
|
45
|
+
* [Error Handling](https://github.com/lambdadb/lambdadb-python-client/blob/master/#error-handling)
|
|
46
|
+
* [Server Selection](https://github.com/lambdadb/lambdadb-python-client/blob/master/#server-selection)
|
|
47
|
+
* [Custom HTTP Client](https://github.com/lambdadb/lambdadb-python-client/blob/master/#custom-http-client)
|
|
48
|
+
* [Resource Management](https://github.com/lambdadb/lambdadb-python-client/blob/master/#resource-management)
|
|
49
|
+
* [Debugging](https://github.com/lambdadb/lambdadb-python-client/blob/master/#debugging)
|
|
50
|
+
* [Development](https://github.com/lambdadb/lambdadb-python-client/blob/master/#development)
|
|
51
|
+
* [Maturity](https://github.com/lambdadb/lambdadb-python-client/blob/master/#maturity)
|
|
52
|
+
* [Contributions](https://github.com/lambdadb/lambdadb-python-client/blob/master/#contributions)
|
|
56
53
|
|
|
57
54
|
<!-- End Table of Contents [toc] -->
|
|
58
55
|
|
|
59
56
|
<!-- Start SDK Installation [installation] -->
|
|
60
57
|
## SDK Installation
|
|
61
58
|
|
|
62
|
-
> [!TIP]
|
|
63
|
-
> 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).
|
|
64
|
-
|
|
65
|
-
|
|
66
59
|
> [!NOTE]
|
|
67
60
|
> **Python version upgrade policy**
|
|
68
61
|
>
|
|
@@ -75,7 +68,7 @@ The SDK can be installed with either *pip* or *poetry* package managers.
|
|
|
75
68
|
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
|
|
76
69
|
|
|
77
70
|
```bash
|
|
78
|
-
pip install
|
|
71
|
+
pip install lambdadb
|
|
79
72
|
```
|
|
80
73
|
|
|
81
74
|
### Poetry
|
|
@@ -83,7 +76,7 @@ pip install git+<UNSET>.git
|
|
|
83
76
|
*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.
|
|
84
77
|
|
|
85
78
|
```bash
|
|
86
|
-
poetry add
|
|
79
|
+
poetry add lambdadb
|
|
87
80
|
```
|
|
88
81
|
|
|
89
82
|
### Shell and script usage with `uv`
|
|
@@ -135,14 +128,14 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
|
|
|
135
128
|
|
|
136
129
|
```python
|
|
137
130
|
# Synchronous Example
|
|
138
|
-
from lambdadb import Lambdadb
|
|
131
|
+
from lambdadb import Lambdadb
|
|
139
132
|
|
|
140
133
|
|
|
141
|
-
with Lambdadb(
|
|
134
|
+
with Lambdadb(
|
|
135
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
136
|
+
) as l_client:
|
|
142
137
|
|
|
143
|
-
res = l_client.projects.list(
|
|
144
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
145
|
-
))
|
|
138
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
146
139
|
|
|
147
140
|
# Handle response
|
|
148
141
|
print(res)
|
|
@@ -154,15 +147,15 @@ The same SDK client can also be used to make asychronous requests by importing a
|
|
|
154
147
|
```python
|
|
155
148
|
# Asynchronous Example
|
|
156
149
|
import asyncio
|
|
157
|
-
from lambdadb import Lambdadb
|
|
150
|
+
from lambdadb import Lambdadb
|
|
158
151
|
|
|
159
152
|
async def main():
|
|
160
153
|
|
|
161
|
-
async with Lambdadb(
|
|
154
|
+
async with Lambdadb(
|
|
155
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
156
|
+
) as l_client:
|
|
162
157
|
|
|
163
|
-
res = await l_client.projects.list_async(
|
|
164
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
165
|
-
))
|
|
158
|
+
res = await l_client.projects.collections.list_async(project_name="<value>")
|
|
166
159
|
|
|
167
160
|
# Handle response
|
|
168
161
|
print(res)
|
|
@@ -196,24 +189,6 @@ with Lambdadb(
|
|
|
196
189
|
# Handle response
|
|
197
190
|
print(res)
|
|
198
191
|
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Per-Operation Security Schemes
|
|
202
|
-
|
|
203
|
-
Some operations in this SDK require the security scheme to be specified at the request level. For example:
|
|
204
|
-
```python
|
|
205
|
-
from lambdadb import Lambdadb, models
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
with Lambdadb() as l_client:
|
|
209
|
-
|
|
210
|
-
res = l_client.projects.list(security=models.ListProjectsSecurity(
|
|
211
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
212
|
-
))
|
|
213
|
-
|
|
214
|
-
# Handle response
|
|
215
|
-
print(res)
|
|
216
|
-
|
|
217
192
|
```
|
|
218
193
|
<!-- End Authentication [security] -->
|
|
219
194
|
|
|
@@ -224,30 +199,25 @@ with Lambdadb() as l_client:
|
|
|
224
199
|
<summary>Available methods</summary>
|
|
225
200
|
|
|
226
201
|
|
|
227
|
-
### [projects](docs/sdks/projects/README.md)
|
|
202
|
+
### [projects](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/projects/README.md)
|
|
228
203
|
|
|
229
|
-
* [list](docs/sdks/projects/README.md#list) - List all projects in an account.
|
|
230
|
-
* [create](docs/sdks/projects/README.md#create) - Create a project.
|
|
231
|
-
* [get](docs/sdks/projects/README.md#get) - Get metadata of an existing project.
|
|
232
|
-
* [delete](docs/sdks/projects/README.md#delete) - Delete an existing project.
|
|
233
|
-
* [update](docs/sdks/projects/README.md#update) - Configure an existing project
|
|
234
204
|
|
|
235
|
-
#### [projects.collections](docs/sdks/collections/README.md)
|
|
205
|
+
#### [projects.collections](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md)
|
|
236
206
|
|
|
237
|
-
* [list](docs/sdks/collections/README.md#list) - List all collections in an existing project.
|
|
238
|
-
* [create](docs/sdks/collections/README.md#create) - Create an collection.
|
|
239
|
-
* [delete](docs/sdks/collections/README.md#delete) - Delete an existing collection.
|
|
240
|
-
* [get](docs/sdks/collections/README.md#get) - Get metadata of an existing collection.
|
|
241
|
-
* [update](docs/sdks/collections/README.md#update) - Configure an collection.
|
|
242
|
-
* [query](docs/sdks/collections/README.md#query) - Search an collection with a query and return the most similar documents.
|
|
207
|
+
* [list](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#list) - List all collections in an existing project.
|
|
208
|
+
* [create](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#create) - Create an collection.
|
|
209
|
+
* [delete](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#delete) - Delete an existing collection.
|
|
210
|
+
* [get](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#get) - Get metadata of an existing collection.
|
|
211
|
+
* [update](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#update) - Configure an collection.
|
|
212
|
+
* [query](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#query) - Search an collection with a query and return the most similar documents.
|
|
243
213
|
|
|
244
|
-
#### [projects.collections.docs](docs/sdks/docs/README.md)
|
|
214
|
+
#### [projects.collections.docs](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md)
|
|
245
215
|
|
|
246
|
-
* [upsert](docs/sdks/docs/README.md#upsert) - Upsert documents into an collection. Note that the maximum supported payload size is 6MB.
|
|
247
|
-
* [get_bulk_upsert](docs/sdks/docs/README.md#get_bulk_upsert) - Request required info to upload documents.
|
|
248
|
-
* [bulk_upsert](docs/sdks/docs/README.md#bulk_upsert) - Bulk upsert documents into an collection. Note that the maximum supported object size is 200MB.
|
|
249
|
-
* [delete](docs/sdks/docs/README.md#delete) - Delete documents by document IDs or query filter from an collection.
|
|
250
|
-
* [fetch](docs/sdks/docs/README.md#fetch) - Lookup and return documents by document IDs from an collection.
|
|
216
|
+
* [upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#upsert) - Upsert documents into an collection. Note that the maximum supported payload size is 6MB.
|
|
217
|
+
* [get_bulk_upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#get_bulk_upsert) - Request required info to upload documents.
|
|
218
|
+
* [bulk_upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#bulk_upsert) - Bulk upsert documents into an collection. Note that the maximum supported object size is 200MB.
|
|
219
|
+
* [delete](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#delete) - Delete documents by document IDs or query filter from an collection.
|
|
220
|
+
* [fetch](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#fetch) - Lookup and return documents by document IDs from an collection.
|
|
251
221
|
|
|
252
222
|
</details>
|
|
253
223
|
<!-- End Available Resources and Operations [operations] -->
|
|
@@ -259,15 +229,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
|
|
|
259
229
|
|
|
260
230
|
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
|
|
261
231
|
```python
|
|
262
|
-
from lambdadb import Lambdadb
|
|
232
|
+
from lambdadb import Lambdadb
|
|
263
233
|
from lambdadb.utils import BackoffStrategy, RetryConfig
|
|
264
234
|
|
|
265
235
|
|
|
266
|
-
with Lambdadb(
|
|
236
|
+
with Lambdadb(
|
|
237
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
238
|
+
) as l_client:
|
|
267
239
|
|
|
268
|
-
res = l_client.projects.list(
|
|
269
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
270
|
-
),
|
|
240
|
+
res = l_client.projects.collections.list(project_name="<value>",
|
|
271
241
|
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
|
|
272
242
|
|
|
273
243
|
# Handle response
|
|
@@ -277,17 +247,16 @@ with Lambdadb() as l_client:
|
|
|
277
247
|
|
|
278
248
|
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:
|
|
279
249
|
```python
|
|
280
|
-
from lambdadb import Lambdadb
|
|
250
|
+
from lambdadb import Lambdadb
|
|
281
251
|
from lambdadb.utils import BackoffStrategy, RetryConfig
|
|
282
252
|
|
|
283
253
|
|
|
284
254
|
with Lambdadb(
|
|
285
255
|
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
|
|
256
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
286
257
|
) as l_client:
|
|
287
258
|
|
|
288
|
-
res = l_client.projects.list(
|
|
289
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
290
|
-
))
|
|
259
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
291
260
|
|
|
292
261
|
# Handle response
|
|
293
262
|
print(res)
|
|
@@ -311,26 +280,27 @@ By default, an API error will raise a errors.APIError exception, which has the f
|
|
|
311
280
|
|
|
312
281
|
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions:
|
|
313
282
|
|
|
314
|
-
| Error Type
|
|
315
|
-
|
|
|
316
|
-
| errors.UnauthenticatedError
|
|
317
|
-
| errors.
|
|
318
|
-
| errors.
|
|
319
|
-
| errors.
|
|
283
|
+
| Error Type | Status Code | Content Type |
|
|
284
|
+
| ---------------------------- | ----------- | ---------------- |
|
|
285
|
+
| errors.UnauthenticatedError | 401 | application/json |
|
|
286
|
+
| errors.ResourceNotFoundError | 404 | application/json |
|
|
287
|
+
| errors.TooManyRequestsError | 429 | application/json |
|
|
288
|
+
| errors.InternalServerError | 500 | application/json |
|
|
289
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
320
290
|
|
|
321
291
|
### Example
|
|
322
292
|
|
|
323
293
|
```python
|
|
324
|
-
from lambdadb import Lambdadb, errors
|
|
294
|
+
from lambdadb import Lambdadb, errors
|
|
325
295
|
|
|
326
296
|
|
|
327
|
-
with Lambdadb(
|
|
297
|
+
with Lambdadb(
|
|
298
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
299
|
+
) as l_client:
|
|
328
300
|
res = None
|
|
329
301
|
try:
|
|
330
302
|
|
|
331
|
-
res = l_client.projects.list(
|
|
332
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
333
|
-
))
|
|
303
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
334
304
|
|
|
335
305
|
# Handle response
|
|
336
306
|
print(res)
|
|
@@ -338,6 +308,9 @@ with Lambdadb() as l_client:
|
|
|
338
308
|
except errors.UnauthenticatedError as e:
|
|
339
309
|
# handle e.data: errors.UnauthenticatedErrorData
|
|
340
310
|
raise(e)
|
|
311
|
+
except errors.ResourceNotFoundError as e:
|
|
312
|
+
# handle e.data: errors.ResourceNotFoundErrorData
|
|
313
|
+
raise(e)
|
|
341
314
|
except errors.TooManyRequestsError as e:
|
|
342
315
|
# handle e.data: errors.TooManyRequestsErrorData
|
|
343
316
|
raise(e)
|
|
@@ -357,16 +330,15 @@ with Lambdadb() as l_client:
|
|
|
357
330
|
|
|
358
331
|
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:
|
|
359
332
|
```python
|
|
360
|
-
from lambdadb import Lambdadb
|
|
333
|
+
from lambdadb import Lambdadb
|
|
361
334
|
|
|
362
335
|
|
|
363
336
|
with Lambdadb(
|
|
364
337
|
server_url="https://{baseUrl}",
|
|
338
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
365
339
|
) as l_client:
|
|
366
340
|
|
|
367
|
-
res = l_client.projects.list(
|
|
368
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
369
|
-
))
|
|
341
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
370
342
|
|
|
371
343
|
# Handle response
|
|
372
344
|
print(res)
|
|
@@ -466,14 +438,18 @@ The `Lambdadb` class implements the context manager protocol and registers a fin
|
|
|
466
438
|
from lambdadb import Lambdadb
|
|
467
439
|
def main():
|
|
468
440
|
|
|
469
|
-
with Lambdadb(
|
|
441
|
+
with Lambdadb(
|
|
442
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
443
|
+
) as l_client:
|
|
470
444
|
# Rest of application here...
|
|
471
445
|
|
|
472
446
|
|
|
473
447
|
# Or when using async:
|
|
474
448
|
async def amain():
|
|
475
449
|
|
|
476
|
-
async with Lambdadb(
|
|
450
|
+
async with Lambdadb(
|
|
451
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
452
|
+
) as l_client:
|
|
477
453
|
# Rest of application here...
|
|
478
454
|
```
|
|
479
455
|
<!-- End Resource Management [resource-management] -->
|
|
@@ -508,7 +484,4 @@ looking for the latest version.
|
|
|
508
484
|
## Contributions
|
|
509
485
|
|
|
510
486
|
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.
|
|
511
|
-
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.
|
|
512
|
-
|
|
513
|
-
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=lambdadb&utm_campaign=python)
|
|
514
|
-
|
|
487
|
+
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.
|