deeporigin-data-sdk 0.1.0a35__py3-none-any.whl → 0.1.0a37__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.
@@ -8,7 +8,7 @@ from typing_extensions import Self, Literal, override
8
8
 
9
9
  import httpx
10
10
 
11
- from . import resources, _exceptions
11
+ from . import _exceptions
12
12
  from ._qs import Querystring
13
13
  from .types import (
14
14
  client_list_rows_params,
@@ -141,7 +141,6 @@ __all__ = [
141
141
  "Transport",
142
142
  "ProxiesTypes",
143
143
  "RequestOptions",
144
- "resources",
145
144
  "DeeporiginData",
146
145
  "AsyncDeeporiginData",
147
146
  "Client",
@@ -46,6 +46,7 @@ from ._utils import (
46
46
  strip_not_given,
47
47
  extract_type_arg,
48
48
  is_annotated_type,
49
+ is_type_alias_type,
49
50
  strip_annotated_type,
50
51
  )
51
52
  from ._compat import (
@@ -428,6 +429,8 @@ def construct_type(*, value: object, type_: object) -> object:
428
429
  # we allow `object` as the input type because otherwise, passing things like
429
430
  # `Literal['value']` will be reported as a type error by type checkers
430
431
  type_ = cast("type[object]", type_)
432
+ if is_type_alias_type(type_):
433
+ type_ = type_.__value__ # type: ignore[unreachable]
431
434
 
432
435
  # unwrap `Annotated[T, ...]` -> `T`
433
436
  if is_annotated_type(type_):
@@ -25,7 +25,7 @@ import httpx
25
25
  import pydantic
26
26
 
27
27
  from ._types import NoneType
28
- from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base
28
+ from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base
29
29
  from ._models import BaseModel, is_basemodel
30
30
  from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER
31
31
  from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type
@@ -126,9 +126,15 @@ class BaseAPIResponse(Generic[R]):
126
126
  )
127
127
 
128
128
  def _parse(self, *, to: type[_T] | None = None) -> R | _T:
129
+ cast_to = to if to is not None else self._cast_to
130
+
131
+ # unwrap `TypeAlias('Name', T)` -> `T`
132
+ if is_type_alias_type(cast_to):
133
+ cast_to = cast_to.__value__ # type: ignore[unreachable]
134
+
129
135
  # unwrap `Annotated[T, ...]` -> `T`
130
- if to and is_annotated_type(to):
131
- to = extract_type_arg(to, 0)
136
+ if cast_to and is_annotated_type(cast_to):
137
+ cast_to = extract_type_arg(cast_to, 0)
132
138
 
133
139
  if self._is_sse_stream:
134
140
  if to:
@@ -164,18 +170,12 @@ class BaseAPIResponse(Generic[R]):
164
170
  return cast(
165
171
  R,
166
172
  stream_cls(
167
- cast_to=self._cast_to,
173
+ cast_to=cast_to,
168
174
  response=self.http_response,
169
175
  client=cast(Any, self._client),
170
176
  ),
171
177
  )
172
178
 
173
- cast_to = to if to is not None else self._cast_to
174
-
175
- # unwrap `Annotated[T, ...]` -> `T`
176
- if is_annotated_type(cast_to):
177
- cast_to = extract_type_arg(cast_to, 0)
178
-
179
179
  if cast_to is NoneType:
180
180
  return cast(R, None)
181
181
 
@@ -39,6 +39,7 @@ from ._typing import (
39
39
  is_iterable_type as is_iterable_type,
40
40
  is_required_type as is_required_type,
41
41
  is_annotated_type as is_annotated_type,
42
+ is_type_alias_type as is_type_alias_type,
42
43
  strip_annotated_type as strip_annotated_type,
43
44
  extract_type_var_from_base as extract_type_var_from_base,
44
45
  )
@@ -1,8 +1,17 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
4
+ import typing
5
+ import typing_extensions
3
6
  from typing import Any, TypeVar, Iterable, cast
4
7
  from collections import abc as _c_abc
5
- from typing_extensions import Required, Annotated, get_args, get_origin
8
+ from typing_extensions import (
9
+ TypeIs,
10
+ Required,
11
+ Annotated,
12
+ get_args,
13
+ get_origin,
14
+ )
6
15
 
7
16
  from .._types import InheritsGeneric
8
17
  from .._compat import is_union as _is_union
@@ -36,6 +45,26 @@ def is_typevar(typ: type) -> bool:
36
45
  return type(typ) == TypeVar # type: ignore
37
46
 
38
47
 
48
+ _TYPE_ALIAS_TYPES: tuple[type[typing_extensions.TypeAliasType], ...] = (typing_extensions.TypeAliasType,)
49
+ if sys.version_info >= (3, 12):
50
+ _TYPE_ALIAS_TYPES = (*_TYPE_ALIAS_TYPES, typing.TypeAliasType)
51
+
52
+
53
+ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
54
+ """Return whether the provided argument is an instance of `TypeAliasType`.
55
+
56
+ ```python
57
+ type Int = int
58
+ is_type_alias_type(Int)
59
+ # > True
60
+ Str = TypeAliasType("Str", str)
61
+ is_type_alias_type(Str)
62
+ # > True
63
+ ```
64
+ """
65
+ return isinstance(tp, _TYPE_ALIAS_TYPES)
66
+
67
+
39
68
  # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
40
69
  def strip_annotated_type(typ: type) -> type:
41
70
  if is_required_type(typ) or is_annotated_type(typ):
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "deeporigin_data"
4
- __version__ = "0.1.0-alpha.35" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.37" # x-release-please-version
@@ -5,8 +5,15 @@ from typing import List
5
5
  from .._models import BaseModel
6
6
  from .shared.database_row import DatabaseRow
7
7
 
8
- __all__ = ["ListDatabaseRowsResponse"]
8
+ __all__ = ["ListDatabaseRowsResponse", "Meta"]
9
+
10
+
11
+ class Meta(BaseModel):
12
+ count: float
13
+ """The total number of rows in the database."""
9
14
 
10
15
 
11
16
  class ListDatabaseRowsResponse(BaseModel):
12
17
  data: List[DatabaseRow]
18
+
19
+ meta: Meta
@@ -1,11 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: deeporigin_data_sdk
3
- Version: 0.1.0a35
3
+ Version: 0.1.0a37
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
7
7
  Author-email: Deeporigin Data <support@deeporigin.com>
8
- License: Apache-2.0
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
9
10
  Classifier: Intended Audience :: Developers
10
11
  Classifier: License :: OSI Approved :: Apache Software License
11
12
  Classifier: Operating System :: MacOS
@@ -26,7 +27,7 @@ Requires-Dist: distro<2,>=1.7.0
26
27
  Requires-Dist: httpx<1,>=0.23.0
27
28
  Requires-Dist: pydantic<3,>=1.9.0
28
29
  Requires-Dist: sniffio
29
- Requires-Dist: typing-extensions<5,>=4.7
30
+ Requires-Dist: typing-extensions<5,>=4.10
30
31
  Description-Content-Type: text/markdown
31
32
 
32
33
  # Deeporigin Data Python API library
@@ -345,6 +346,18 @@ client.with_options(http_client=DefaultHttpxClient(...))
345
346
 
346
347
  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
347
348
 
349
+ ```py
350
+ from deeporigin_data import DeeporiginData
351
+
352
+ with DeeporiginData(
353
+ org_id="My Org ID",
354
+ ) as client:
355
+ # make requests here
356
+ ...
357
+
358
+ # HTTP client is now closed
359
+ ```
360
+
348
361
  ## Versioning
349
362
 
350
363
  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
@@ -1,26 +1,26 @@
1
1
  deeporigin_data/__init__.py,sha256=g5vq9kCCiWBl8XgJzXdUB9AIdRypOEj9pQH8WJJEVxo,2533
2
2
  deeporigin_data/_base_client.py,sha256=S5oZPMoWvnH4vdTsMwR8KYI6qg4OF6lydyeTmXwndwA,68045
3
- deeporigin_data/_client.py,sha256=HHl30KLhtDRrEKLN41Q51m6yBcZcDFl8-6azbSzUNDU,170041
3
+ deeporigin_data/_client.py,sha256=gw3btWS4DUDmZOwnokS6nasXMnd-WYzIK4dLfhwaA0Q,170013
4
4
  deeporigin_data/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  deeporigin_data/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
6
6
  deeporigin_data/_exceptions.py,sha256=_25MmrwuBf1sxAJESpY5sPn1o5E-aUymr6wDuRSWIng,3236
7
7
  deeporigin_data/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- deeporigin_data/_models.py,sha256=uhxvXZC0JO7HuGR_GWXH-zYKuptF2rwiGVJfMMfg3fw,28470
8
+ deeporigin_data/_models.py,sha256=iumFIitiWZTGITgF2nwOmEPIJGIEeJaUXhDlpaSN9Wg,28589
9
9
  deeporigin_data/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  deeporigin_data/_resource.py,sha256=tkm4gF9YRotE93j48jTDBSGs8wyVa0E5NS9fj19e38c,1148
11
- deeporigin_data/_response.py,sha256=nzKdjRA8W3Rwgvgv6zCu4LISsdLUPCQjedlOp_NWyUY,28691
11
+ deeporigin_data/_response.py,sha256=Kj-Zi9_3rAr8jDDHy2yTG8SCMF2a7dilTyE-yQO7pag,28747
12
12
  deeporigin_data/_streaming.py,sha256=yG857cOSJD3gbc7mEc2wqfvcPVLMGmYX4hBOqqIT5RE,10132
13
13
  deeporigin_data/_types.py,sha256=HI5vtFJGLEsyOrrWJRSRtUeOSrd8EdoM020wC51GvcI,6152
14
- deeporigin_data/_version.py,sha256=XsXSGRmMXd-kgBUt2rx6NaefthU4Xbo8r44ftW8R-cw,176
14
+ deeporigin_data/_version.py,sha256=-8TIpPx4H69iaMdvsw5A9ZTw8shEbHT04p9Dzh2b-8A,176
15
15
  deeporigin_data/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- deeporigin_data/_utils/__init__.py,sha256=k266EatJr88V8Zseb7xUimTlCeno9SynRfLwadHP1b4,2016
16
+ deeporigin_data/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  deeporigin_data/_utils/_logs.py,sha256=R7dnUaDs2cdYbq1Ee16dHy863wdcTZRRzubw9KE0qNc,801
18
18
  deeporigin_data/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
19
19
  deeporigin_data/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
20
  deeporigin_data/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
21
  deeporigin_data/_utils/_sync.py,sha256=jJl-iCEaZZUAkq4IUtzN1-aMsKTUFaNoNbeYnnpQjIQ,2438
22
22
  deeporigin_data/_utils/_transform.py,sha256=Dkkyr7OveGmOolepcvXmVJWE3kqim4b0nM0h7yWbgeY,13468
23
- deeporigin_data/_utils/_typing.py,sha256=tFbktdpdHCQliwzGsWysgn0P5H0JRdagkZdb_LegGkY,3838
23
+ deeporigin_data/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
24
24
  deeporigin_data/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
25
  deeporigin_data/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
26
  deeporigin_data/resources/__init__.py,sha256=ikKh5ucm9qFI-Z42nOKxhBhEI-YHaaxvsSddO_Nx0-Y,86
@@ -93,7 +93,7 @@ deeporigin_data/types/execute_code_async_response.py,sha256=3aMS6SENWG7Kkrew1ft6
93
93
  deeporigin_data/types/execute_code_sync_response.py,sha256=oaHWfR_YOHhlYoSGASW8omVCuV4BIwevCkWM4h-eCc4,1141
94
94
  deeporigin_data/types/import_rows_response.py,sha256=-QVvCuMGzyVauspVJMGhZRd6zzczutwF03EfBkB3mSA,408
95
95
  deeporigin_data/types/list_database_column_unique_values_v2_response.py,sha256=T8GhFFiYJyYlki0URY0c_YaMAUv2TTmGvpuTq0r2n0E,389
96
- deeporigin_data/types/list_database_rows_response.py,sha256=NBDHhz5hkqYVF2hSucKorjOjO7hVU7GMAEv3AokGiNs,302
96
+ deeporigin_data/types/list_database_rows_response.py,sha256=s99W98Cdli8gpqiWKp0yCTraCwPVt2jPiVWjLgloQLU,420
97
97
  deeporigin_data/types/list_files_response.py,sha256=uKDQKAr33pEFNbfXqtPP1d2XMm7Ln5h_2M_55umNjVk,517
98
98
  deeporigin_data/types/list_mentions_response.py,sha256=hAlMq4lpghcDGDY55w5HszSUp9aOKbZzS4e2j617A84,620
99
99
  deeporigin_data/types/list_row_back_references_response.py,sha256=eT1ibMxUGTh5hL3Lt9fQgTf_efwYofxGVxaZab6r-lo,348
@@ -120,7 +120,7 @@ deeporigin_data/types/shared_params/add_column_base.py,sha256=KfTFZFnCy08oqgSPAl
120
120
  deeporigin_data/types/shared_params/add_column_union.py,sha256=q4Ia_xvxdAF7RnKicd5QDs-WMKePG_PY-xnQ0SaJRmc,971
121
121
  deeporigin_data/types/shared_params/condition.py,sha256=ftu-hdGv05aTv4GL9bRyf4kQXl27kaPpt3P4KKdwmNM,2723
122
122
  deeporigin_data/types/shared_params/row_filter_join.py,sha256=QIo2yhjJJZLcGF-hBF7YcLcYHLhf5uq5EkQG-0WJjtU,595
123
- deeporigin_data_sdk-0.1.0a35.dist-info/METADATA,sha256=He3nYa6wLGxknfnyjAYMFkntZsNeqpZC3LLAddY2QO4,13216
124
- deeporigin_data_sdk-0.1.0a35.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
125
- deeporigin_data_sdk-0.1.0a35.dist-info/licenses/LICENSE,sha256=qQA5hv0RJh5jpG5jw4cmr1gPxsNivnMjHFpEOTGWZyI,11345
126
- deeporigin_data_sdk-0.1.0a35.dist-info/RECORD,,
123
+ deeporigin_data_sdk-0.1.0a37.dist-info/METADATA,sha256=8JcFTA-rSupDbXCfDq8AvDvbxVvqOOrgrmER_vGcWWg,13421
124
+ deeporigin_data_sdk-0.1.0a37.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
125
+ deeporigin_data_sdk-0.1.0a37.dist-info/licenses/LICENSE,sha256=qQA5hv0RJh5jpG5jw4cmr1gPxsNivnMjHFpEOTGWZyI,11345
126
+ deeporigin_data_sdk-0.1.0a37.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any