lambdadb 0.2.1__py3-none-any.whl → 0.3.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.

Potentially problematic release.


This version of lambdadb might be problematic. Click here for more details.

lambdadb/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "lambdadb"
6
- __version__: str = "0.2.1"
6
+ __version__: str = "0.3.0"
7
7
  __openapi_doc_version__: str = "1.1.0"
8
- __gen_version__: str = "2.628.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.2.1 2.628.0 1.1.0 lambdadb"
8
+ __gen_version__: str = "2.634.2"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.3.0 2.634.2 1.1.0 lambdadb"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
lambdadb/sdk.py CHANGED
@@ -14,15 +14,15 @@ from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast
14
14
  import weakref
15
15
 
16
16
  if TYPE_CHECKING:
17
- from lambdadb.projects import Projects
17
+ from lambdadb.collections import Collections
18
18
 
19
19
 
20
- class Lambdadb(BaseSDK):
20
+ class LambdaDB(BaseSDK):
21
21
  r"""LambdaDB API: LambdaDB Open API Spec"""
22
22
 
23
- projects: "Projects"
23
+ collections: "Collections"
24
24
  _sub_sdk_map = {
25
- "projects": ("lambdadb.projects", "Projects"),
25
+ "collections": ("lambdadb.collections", "Collections"),
26
26
  }
27
27
 
28
28
  def __init__(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lambdadb
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -98,9 +98,9 @@ It's also possible to write a standalone Python script without needing to set up
98
98
  # ]
99
99
  # ///
100
100
 
101
- from lambdadb import Lambdadb
101
+ from lambdadb import LambdaDB
102
102
 
103
- sdk = Lambdadb(
103
+ sdk = LambdaDB(
104
104
  # SDK arguments
105
105
  )
106
106
 
@@ -128,14 +128,14 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
128
128
 
129
129
  ```python
130
130
  # Synchronous Example
131
- from lambdadb import Lambdadb
131
+ from lambdadb import LambdaDB
132
132
 
133
133
 
134
- with Lambdadb(
134
+ with LambdaDB(
135
135
  project_api_key="<YOUR_PROJECT_API_KEY>",
136
- ) as l_client:
136
+ ) as lambda_db:
137
137
 
138
- res = l_client.projects.collections.list(project_name="<value>")
138
+ res = lambda_db.collections.list(project_name="<value>")
139
139
 
140
140
  # Handle response
141
141
  print(res)
@@ -147,15 +147,15 @@ The same SDK client can also be used to make asychronous requests by importing a
147
147
  ```python
148
148
  # Asynchronous Example
149
149
  import asyncio
150
- from lambdadb import Lambdadb
150
+ from lambdadb import LambdaDB
151
151
 
152
152
  async def main():
153
153
 
154
- async with Lambdadb(
154
+ async with LambdaDB(
155
155
  project_api_key="<YOUR_PROJECT_API_KEY>",
156
- ) as l_client:
156
+ ) as lambda_db:
157
157
 
158
- res = await l_client.projects.collections.list_async(project_name="<value>")
158
+ res = await lambda_db.collections.list_async(project_name="<value>")
159
159
 
160
160
  # Handle response
161
161
  print(res)
@@ -177,14 +177,14 @@ This SDK supports the following security scheme globally:
177
177
 
178
178
  To authenticate with the API the `project_api_key` parameter must be set when initializing the SDK client instance. For example:
179
179
  ```python
180
- from lambdadb import Lambdadb
180
+ from lambdadb import LambdaDB
181
181
 
182
182
 
183
- with Lambdadb(
183
+ with LambdaDB(
184
184
  project_api_key="<YOUR_PROJECT_API_KEY>",
185
- ) as l_client:
185
+ ) as lambda_db:
186
186
 
187
- res = l_client.projects.collections.list(project_name="<value>")
187
+ res = lambda_db.collections.list(project_name="<value>")
188
188
 
189
189
  # Handle response
190
190
  print(res)
@@ -198,11 +198,7 @@ with Lambdadb(
198
198
  <details open>
199
199
  <summary>Available methods</summary>
200
200
 
201
-
202
- ### [projects](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/projects/README.md)
203
-
204
-
205
- #### [projects.collections](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md)
201
+ ### [collections](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md)
206
202
 
207
203
  * [list](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#list) - List all collections in an existing project.
208
204
  * [create](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#create) - Create an collection.
@@ -211,7 +207,7 @@ with Lambdadb(
211
207
  * [update](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#update) - Configure an collection.
212
208
  * [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.
213
209
 
214
- #### [projects.collections.docs](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md)
210
+ #### [collections.docs](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md)
215
211
 
216
212
  * [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
213
  * [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.
@@ -219,6 +215,7 @@ with Lambdadb(
219
215
  * [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
216
  * [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.
221
217
 
218
+
222
219
  </details>
223
220
  <!-- End Available Resources and Operations [operations] -->
224
221
 
@@ -229,15 +226,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
229
226
 
230
227
  To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
231
228
  ```python
232
- from lambdadb import Lambdadb
229
+ from lambdadb import LambdaDB
233
230
  from lambdadb.utils import BackoffStrategy, RetryConfig
234
231
 
235
232
 
236
- with Lambdadb(
233
+ with LambdaDB(
237
234
  project_api_key="<YOUR_PROJECT_API_KEY>",
238
- ) as l_client:
235
+ ) as lambda_db:
239
236
 
240
- res = l_client.projects.collections.list(project_name="<value>",
237
+ res = lambda_db.collections.list(project_name="<value>",
241
238
  RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
242
239
 
243
240
  # Handle response
@@ -247,16 +244,16 @@ with Lambdadb(
247
244
 
248
245
  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:
249
246
  ```python
250
- from lambdadb import Lambdadb
247
+ from lambdadb import LambdaDB
251
248
  from lambdadb.utils import BackoffStrategy, RetryConfig
252
249
 
253
250
 
254
- with Lambdadb(
251
+ with LambdaDB(
255
252
  retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
256
253
  project_api_key="<YOUR_PROJECT_API_KEY>",
257
- ) as l_client:
254
+ ) as lambda_db:
258
255
 
259
- res = l_client.projects.collections.list(project_name="<value>")
256
+ res = lambda_db.collections.list(project_name="<value>")
260
257
 
261
258
  # Handle response
262
259
  print(res)
@@ -291,16 +288,16 @@ When custom error responses are specified for an operation, the SDK may also rai
291
288
  ### Example
292
289
 
293
290
  ```python
294
- from lambdadb import Lambdadb, errors
291
+ from lambdadb import LambdaDB, errors
295
292
 
296
293
 
297
- with Lambdadb(
294
+ with LambdaDB(
298
295
  project_api_key="<YOUR_PROJECT_API_KEY>",
299
- ) as l_client:
296
+ ) as lambda_db:
300
297
  res = None
301
298
  try:
302
299
 
303
- res = l_client.projects.collections.list(project_name="<value>")
300
+ res = lambda_db.collections.list(project_name="<value>")
304
301
 
305
302
  # Handle response
306
303
  print(res)
@@ -330,15 +327,15 @@ with Lambdadb(
330
327
 
331
328
  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:
332
329
  ```python
333
- from lambdadb import Lambdadb
330
+ from lambdadb import LambdaDB
334
331
 
335
332
 
336
- with Lambdadb(
333
+ with LambdaDB(
337
334
  server_url="https://{baseUrl}",
338
335
  project_api_key="<YOUR_PROJECT_API_KEY>",
339
- ) as l_client:
336
+ ) as lambda_db:
340
337
 
341
- res = l_client.projects.collections.list(project_name="<value>")
338
+ res = lambda_db.collections.list(project_name="<value>")
342
339
 
343
340
  # Handle response
344
341
  print(res)
@@ -355,16 +352,16 @@ This allows you to wrap the client with your own custom logic, such as adding cu
355
352
 
356
353
  For example, you could specify a header for every request that this sdk makes as follows:
357
354
  ```python
358
- from lambdadb import Lambdadb
355
+ from lambdadb import LambdaDB
359
356
  import httpx
360
357
 
361
358
  http_client = httpx.Client(headers={"x-custom-header": "someValue"})
362
- s = Lambdadb(client=http_client)
359
+ s = LambdaDB(client=http_client)
363
360
  ```
364
361
 
365
362
  or you could wrap the client with your own custom logic:
366
363
  ```python
367
- from lambdadb import Lambdadb
364
+ from lambdadb import LambdaDB
368
365
  from lambdadb.httpclient import AsyncHttpClient
369
366
  import httpx
370
367
 
@@ -423,33 +420,33 @@ class CustomClient(AsyncHttpClient):
423
420
  extensions=extensions,
424
421
  )
425
422
 
426
- s = Lambdadb(async_client=CustomClient(httpx.AsyncClient()))
423
+ s = LambdaDB(async_client=CustomClient(httpx.AsyncClient()))
427
424
  ```
428
425
  <!-- End Custom HTTP Client [http-client] -->
429
426
 
430
427
  <!-- Start Resource Management [resource-management] -->
431
428
  ## Resource Management
432
429
 
433
- The `Lambdadb` 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.
430
+ The `LambdaDB` 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.
434
431
 
435
432
  [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
436
433
 
437
434
  ```python
438
- from lambdadb import Lambdadb
435
+ from lambdadb import LambdaDB
439
436
  def main():
440
437
 
441
- with Lambdadb(
438
+ with LambdaDB(
442
439
  project_api_key="<YOUR_PROJECT_API_KEY>",
443
- ) as l_client:
440
+ ) as lambda_db:
444
441
  # Rest of application here...
445
442
 
446
443
 
447
444
  # Or when using async:
448
445
  async def amain():
449
446
 
450
- async with Lambdadb(
447
+ async with LambdaDB(
451
448
  project_api_key="<YOUR_PROJECT_API_KEY>",
452
- ) as l_client:
449
+ ) as lambda_db:
453
450
  # Rest of application here...
454
451
  ```
455
452
  <!-- End Resource Management [resource-management] -->
@@ -461,11 +458,11 @@ You can setup your SDK to emit debug logs for SDK requests and responses.
461
458
 
462
459
  You can pass your own logger class directly into your SDK.
463
460
  ```python
464
- from lambdadb import Lambdadb
461
+ from lambdadb import LambdaDB
465
462
  import logging
466
463
 
467
464
  logging.basicConfig(level=logging.DEBUG)
468
- s = Lambdadb(debug_logger=logging.getLogger("lambdadb"))
465
+ s = LambdaDB(debug_logger=logging.getLogger("lambdadb"))
469
466
  ```
470
467
 
471
468
  You can also enable a default debug logger by setting an environment variable `LAMBDADB_DEBUG` to true.
@@ -3,7 +3,7 @@ lambdadb/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,1
3
3
  lambdadb/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
4
4
  lambdadb/_hooks/sdkhooks.py,sha256=KGhPvIuUjurDBQOT6t-aWgiu1YDRXpn-OMz6_PkUdFk,2463
5
5
  lambdadb/_hooks/types.py,sha256=09dUW5q4HN9aVFAhskDLQqjxLPBfDD97uuucmdcBa6Q,2987
6
- lambdadb/_version.py,sha256=PvN6nJn8YeJhMQtzbXZAULG154_eR-_Ol9BmMZcbGA4,458
6
+ lambdadb/_version.py,sha256=Qod4WO9QVi_ERCk7yMG1nBjFLUCMF78qAucG9SoK6to,458
7
7
  lambdadb/basesdk.py,sha256=Uo8ZEdXVHmS_j1F9on47XeJD6sj9plIrna_6Oo_1I-I,11853
8
8
  lambdadb/collections.py,sha256=ridtbk8Ft0O1lIcpX7-_-5zDV8B0bOcttoxlv5eMeZ0,69015
9
9
  lambdadb/docs.py,sha256=jtrogN__GPuavf2bySAjklPLvtm0JMDezkY2qSlc83k,57368
@@ -32,9 +32,8 @@ lambdadb/models/security.py,sha256=nP-VTWFY6O-UPNPsWcsg38JcXr2zSy_m7qieDix6SxA,6
32
32
  lambdadb/models/status.py,sha256=pl66KcDT9ao6yLXXXOBqerh_StjpNiJb34Yf7VoijEI,250
33
33
  lambdadb/models/updatecollectionop.py,sha256=AH-xDQYtywu6rn5clKKXIuamXk3iYdwSfN5kCi5Ygtk,1470
34
34
  lambdadb/models/upsertdocsop.py,sha256=6oMppMfQtgyVoUrNZ6S_qWFMZmkmPBqQumGWzN78nNk,1684
35
- lambdadb/projects.py,sha256=C3NlfWplO4rsiejfCOzdSghCI3HqayA-H6gfsEeab3c,516
36
35
  lambdadb/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
37
- lambdadb/sdk.py,sha256=IxNrSAABHB12ncsSOFVweuSOSwHECQQwhq1CK4G-5Iw,6076
36
+ lambdadb/sdk.py,sha256=r_MR7eLbat4LunLaRLw3GdkxXubZ6hEn0kegigYJ3vk,6097
38
37
  lambdadb/sdkconfiguration.py,sha256=-sHtaoBluBcNOYRTKxLMnovJazRm3ZWV9VOYCSS0UNY,1589
39
38
  lambdadb/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
40
39
  lambdadb/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
@@ -54,7 +53,7 @@ lambdadb/utils/security.py,sha256=Dq3M6Ee_x_uWRPZ7vvM4XQNxjCMSlphrRn6qVs1pljU,60
54
53
  lambdadb/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
55
54
  lambdadb/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
56
55
  lambdadb/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
57
- lambdadb-0.2.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
58
- lambdadb-0.2.1.dist-info/METADATA,sha256=UAAyHBjVWJHVSqsvjAS2_mHTsZpyx5M_4W69CWaNZEg,18666
59
- lambdadb-0.2.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
60
- lambdadb-0.2.1.dist-info/RECORD,,
56
+ lambdadb-0.3.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
57
+ lambdadb-0.3.0.dist-info/METADATA,sha256=V_VjxhVv8txjdqGbk0QqeP2xBHFBd-aq_r_sjM031Mo,18490
58
+ lambdadb-0.3.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
59
+ lambdadb-0.3.0.dist-info/RECORD,,
lambdadb/projects.py DELETED
@@ -1,17 +0,0 @@
1
- """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
-
3
- from .basesdk import BaseSDK
4
- from .sdkconfiguration import SDKConfiguration
5
- from lambdadb.collections import Collections
6
-
7
-
8
- class Projects(BaseSDK):
9
- collections: Collections
10
-
11
- def __init__(self, sdk_config: SDKConfiguration) -> None:
12
- BaseSDK.__init__(self, sdk_config)
13
- self.sdk_configuration = sdk_config
14
- self._init_sdks()
15
-
16
- def _init_sdks(self):
17
- self.collections = Collections(self.sdk_configuration)