deeporigin-data-sdk 0.1.0a68__py3-none-any.whl → 0.1.0a70__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.
- deeporigin_data/__init__.py +2 -1
- deeporigin_data/_base_client.py +22 -0
- deeporigin_data/_version.py +1 -1
- {deeporigin_data_sdk-0.1.0a68.dist-info → deeporigin_data_sdk-0.1.0a70.dist-info}/METADATA +39 -1
- {deeporigin_data_sdk-0.1.0a68.dist-info → deeporigin_data_sdk-0.1.0a70.dist-info}/RECORD +7 -7
- {deeporigin_data_sdk-0.1.0a68.dist-info → deeporigin_data_sdk-0.1.0a70.dist-info}/WHEEL +0 -0
- {deeporigin_data_sdk-0.1.0a68.dist-info → deeporigin_data_sdk-0.1.0a70.dist-info}/licenses/LICENSE +0 -0
deeporigin_data/__init__.py
CHANGED
@@ -36,7 +36,7 @@ from ._exceptions import (
|
|
36
36
|
UnprocessableEntityError,
|
37
37
|
APIResponseValidationError,
|
38
38
|
)
|
39
|
-
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
|
39
|
+
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
|
40
40
|
from ._utils._logs import setup_logging as _setup_logging
|
41
41
|
|
42
42
|
__all__ = [
|
@@ -78,6 +78,7 @@ __all__ = [
|
|
78
78
|
"DEFAULT_CONNECTION_LIMITS",
|
79
79
|
"DefaultHttpxClient",
|
80
80
|
"DefaultAsyncHttpxClient",
|
81
|
+
"DefaultAioHttpClient",
|
81
82
|
]
|
82
83
|
|
83
84
|
if not _t.TYPE_CHECKING:
|
deeporigin_data/_base_client.py
CHANGED
@@ -1289,6 +1289,24 @@ class _DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
1289
1289
|
super().__init__(**kwargs)
|
1290
1290
|
|
1291
1291
|
|
1292
|
+
try:
|
1293
|
+
import httpx_aiohttp
|
1294
|
+
except ImportError:
|
1295
|
+
|
1296
|
+
class _DefaultAioHttpClient(httpx.AsyncClient):
|
1297
|
+
def __init__(self, **_kwargs: Any) -> None:
|
1298
|
+
raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra")
|
1299
|
+
else:
|
1300
|
+
|
1301
|
+
class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
1302
|
+
def __init__(self, **kwargs: Any) -> None:
|
1303
|
+
kwargs.setdefault("timeout", DEFAULT_TIMEOUT)
|
1304
|
+
kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS)
|
1305
|
+
kwargs.setdefault("follow_redirects", True)
|
1306
|
+
|
1307
|
+
super().__init__(**kwargs)
|
1308
|
+
|
1309
|
+
|
1292
1310
|
if TYPE_CHECKING:
|
1293
1311
|
DefaultAsyncHttpxClient = httpx.AsyncClient
|
1294
1312
|
"""An alias to `httpx.AsyncClient` that provides the same defaults that this SDK
|
@@ -1297,8 +1315,12 @@ if TYPE_CHECKING:
|
|
1297
1315
|
This is useful because overriding the `http_client` with your own instance of
|
1298
1316
|
`httpx.AsyncClient` will result in httpx's defaults being used, not ours.
|
1299
1317
|
"""
|
1318
|
+
|
1319
|
+
DefaultAioHttpClient = httpx.AsyncClient
|
1320
|
+
"""An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`."""
|
1300
1321
|
else:
|
1301
1322
|
DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient
|
1323
|
+
DefaultAioHttpClient = _DefaultAioHttpClient
|
1302
1324
|
|
1303
1325
|
|
1304
1326
|
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
|
deeporigin_data/_version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: deeporigin_data_sdk
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.0a70
|
4
4
|
Summary: The official Python library for the deeporigin_data API
|
5
5
|
Project-URL: Homepage, https://github.com/deeporiginbio/deeporigin-data-sdk
|
6
6
|
Project-URL: Repository, https://github.com/deeporiginbio/deeporigin-data-sdk
|
@@ -27,6 +27,9 @@ Requires-Dist: httpx<1,>=0.23.0
|
|
27
27
|
Requires-Dist: pydantic<3,>=1.9.0
|
28
28
|
Requires-Dist: sniffio
|
29
29
|
Requires-Dist: typing-extensions<5,>=4.10
|
30
|
+
Provides-Extra: aiohttp
|
31
|
+
Requires-Dist: aiohttp; extra == 'aiohttp'
|
32
|
+
Requires-Dist: httpx-aiohttp>=0.1.6; extra == 'aiohttp'
|
30
33
|
Description-Content-Type: text/markdown
|
31
34
|
|
32
35
|
# Deeporigin Data Python API library
|
@@ -101,6 +104,41 @@ asyncio.run(main())
|
|
101
104
|
|
102
105
|
Functionality between the synchronous and asynchronous clients is otherwise identical.
|
103
106
|
|
107
|
+
### With aiohttp
|
108
|
+
|
109
|
+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
|
110
|
+
|
111
|
+
You can enable this by installing `aiohttp`:
|
112
|
+
|
113
|
+
```sh
|
114
|
+
# install from PyPI
|
115
|
+
pip install --pre deeporigin_data_sdk[aiohttp]
|
116
|
+
```
|
117
|
+
|
118
|
+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
119
|
+
|
120
|
+
```python
|
121
|
+
import os
|
122
|
+
import asyncio
|
123
|
+
from deeporigin_data import DefaultAioHttpClient
|
124
|
+
from deeporigin_data import AsyncDeeporiginData
|
125
|
+
|
126
|
+
|
127
|
+
async def main() -> None:
|
128
|
+
async with AsyncDeeporiginData(
|
129
|
+
org_id="My Org ID",
|
130
|
+
token=os.environ.get("ORG_BEARER_TOKEN"), # This is the default and can be omitted
|
131
|
+
http_client=DefaultAioHttpClient(),
|
132
|
+
) as client:
|
133
|
+
describe_row_response = await client.describe_row(
|
134
|
+
row_id="rowId",
|
135
|
+
)
|
136
|
+
print(describe_row_response.data)
|
137
|
+
|
138
|
+
|
139
|
+
asyncio.run(main())
|
140
|
+
```
|
141
|
+
|
104
142
|
## Using types
|
105
143
|
|
106
144
|
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
|
@@ -1,5 +1,5 @@
|
|
1
|
-
deeporigin_data/__init__.py,sha256=
|
2
|
-
deeporigin_data/_base_client.py,sha256=
|
1
|
+
deeporigin_data/__init__.py,sha256=GcSYGhjO8h3JlVcNC7CouZJUsoefUYjFRQFRpylXg5c,2694
|
2
|
+
deeporigin_data/_base_client.py,sha256=xAVMwRYOW6B9fGncMM-yE2yDlBMVsb9QSHB1Q5ayDRk,66724
|
3
3
|
deeporigin_data/_client.py,sha256=ulANUIkBX3gHIvrpeU1IRCakrx5gIcgD56I0FmwiaXo,171969
|
4
4
|
deeporigin_data/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
5
|
deeporigin_data/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
@@ -11,7 +11,7 @@ deeporigin_data/_resource.py,sha256=tkm4gF9YRotE93j48jTDBSGs8wyVa0E5NS9fj19e38c,
|
|
11
11
|
deeporigin_data/_response.py,sha256=i98w-_OFUAnDfRaLynqu2Qrgh39xKGq9WQ1DK2CueMs,28870
|
12
12
|
deeporigin_data/_streaming.py,sha256=yG857cOSJD3gbc7mEc2wqfvcPVLMGmYX4hBOqqIT5RE,10132
|
13
13
|
deeporigin_data/_types.py,sha256=z_gHfGnZNr7ReZxda_iICWQnmy5anm8-i8lRB3jpRL0,6206
|
14
|
-
deeporigin_data/_version.py,sha256=
|
14
|
+
deeporigin_data/_version.py,sha256=sjIyW8sptxaYyWITCuIK_jyarI_VujmzEyAFyaZMvSU,176
|
15
15
|
deeporigin_data/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
deeporigin_data/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
deeporigin_data/_utils/_logs.py,sha256=R7dnUaDs2cdYbq1Ee16dHy863wdcTZRRzubw9KE0qNc,801
|
@@ -121,7 +121,7 @@ deeporigin_data/types/shared_params/add_column_base.py,sha256=s8cbOjluJmf4Pzmg_v
|
|
121
121
|
deeporigin_data/types/shared_params/add_column_union.py,sha256=uEJwB-xtbKY19Hq7a2vIrGdDfPcHIBwp9_R63Qf9KO0,1036
|
122
122
|
deeporigin_data/types/shared_params/condition.py,sha256=38ItZ9QZrA3rnXNgds7KZcXCZ-h1zVttiD1R6uf5IGQ,3153
|
123
123
|
deeporigin_data/types/shared_params/row_filter_join.py,sha256=QIo2yhjJJZLcGF-hBF7YcLcYHLhf5uq5EkQG-0WJjtU,595
|
124
|
-
deeporigin_data_sdk-0.1.
|
125
|
-
deeporigin_data_sdk-0.1.
|
126
|
-
deeporigin_data_sdk-0.1.
|
127
|
-
deeporigin_data_sdk-0.1.
|
124
|
+
deeporigin_data_sdk-0.1.0a70.dist-info/METADATA,sha256=RcpnBOJ_NH5aLt59I8jv4BVoQ1AD1e7Degd7MDQyIJ4,14863
|
125
|
+
deeporigin_data_sdk-0.1.0a70.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
126
|
+
deeporigin_data_sdk-0.1.0a70.dist-info/licenses/LICENSE,sha256=jT1To9IZ3XdRqtpv8wDrIwpatTUvf5yP0sFYhEtJVZY,11345
|
127
|
+
deeporigin_data_sdk-0.1.0a70.dist-info/RECORD,,
|
File without changes
|
{deeporigin_data_sdk-0.1.0a68.dist-info → deeporigin_data_sdk-0.1.0a70.dist-info}/licenses/LICENSE
RENAMED
File without changes
|