dataleon 0.1.0a4__tar.gz → 0.1.0a6__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.
- dataleon-0.1.0a6/.release-please-manifest.json +3 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/CHANGELOG.md +23 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/PKG-INFO +1 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/pyproject.toml +5 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/requirements-dev.lock +5 -2
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/requirements.lock +5 -2
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/__init__.py +3 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_base_client.py +9 -9
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_client.py +8 -8
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_models.py +10 -4
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_qs.py +7 -7
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_types.py +18 -11
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_transform.py +2 -2
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_utils.py +4 -4
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_version.py +1 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/companies/companies.py +39 -39
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/companies/documents.py +9 -9
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/individuals/documents.py +9 -9
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/individuals/individuals.py +43 -43
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_create_params.py +5 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_registration.py +5 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_update_params.py +5 -1
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual.py +5 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual_create_params.py +4 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual_update_params.py +4 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/test_companies.py +4 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/test_individuals.py +4 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_transform.py +9 -2
- dataleon-0.1.0a4/.release-please-manifest.json +0 -3
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/.gitignore +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/CONTRIBUTING.md +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/LICENSE +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/README.md +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/SECURITY.md +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/api.md +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/bin/check-release-environment +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/bin/publish-pypi +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/examples/.keep +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/noxfile.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/release-please-config.json +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_compat.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_constants.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_exceptions.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_files.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_resource.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_response.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_streaming.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_compat.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_datetime_parse.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_logs.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_proxy.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_reflection.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_resources_proxy.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_streams.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_sync.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/_utils/_typing.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/lib/.keep +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/py.typed +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/companies/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/resources/individuals/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/companies/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/companies/document_upload_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_list_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_list_response.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/company_retrieve_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual_list_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual_list_response.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individual_retrieve_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individuals/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individuals/document_response.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individuals/document_upload_params.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/individuals/generic_document.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/shared/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/src/dataleon/types/shared/check.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/companies/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/companies/test_documents.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/individuals/__init__.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/api_resources/individuals/test_documents.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/conftest.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/sample_file.txt +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_client.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_deepcopy.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_extract_files.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_files.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_models.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_qs.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_required_args.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_response.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_streaming.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_utils/test_datetime_parse.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_utils/test_proxy.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/test_utils/test_typing.py +0 -0
- {dataleon-0.1.0a4 → dataleon-0.1.0a6}/tests/utils.py +0 -0
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.6 (2025-10-14)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/dataleonlabs/dataleon-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([5e6943f](https://github.com/dataleonlabs/dataleon-python/commit/5e6943fc5724b9bf19cb8958b6d06f4b0abefcaf))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** detect missing future annotations with ruff ([7ed7019](https://github.com/dataleonlabs/dataleon-python/commit/7ed7019f18938d0b0ac99c18478696bb352dfd63))
|
|
15
|
+
|
|
16
|
+
## 0.1.0-alpha.5 (2025-09-20)
|
|
17
|
+
|
|
18
|
+
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/dataleonlabs/dataleon-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([6a205a7](https://github.com/dataleonlabs/dataleon-python/commit/6a205a725a4ab48a90c8b4a54ef68d3d3e85b068))
|
|
23
|
+
* **internal:** update pydantic dependency ([59a4c39](https://github.com/dataleonlabs/dataleon-python/commit/59a4c398f569e19bda1dabb3ea4b4e5e5d2a5bc1))
|
|
24
|
+
* **types:** change optional parameter type from NotGiven to Omit ([70511ef](https://github.com/dataleonlabs/dataleon-python/commit/70511ef335ba875c0e03677349c44ab7a2609989))
|
|
25
|
+
|
|
3
26
|
## 0.1.0-alpha.4 (2025-09-10)
|
|
4
27
|
|
|
5
28
|
Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/dataleonlabs/dataleon-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dataleon
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a6
|
|
4
4
|
Summary: The official Python library for the dataleon API
|
|
5
5
|
Project-URL: Homepage, https://github.com/dataleonlabs/dataleon-python
|
|
6
6
|
Project-URL: Repository, https://github.com/dataleonlabs/dataleon-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dataleon"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.6"
|
|
4
4
|
description = "The official Python library for the dataleon API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -224,6 +224,8 @@ select = [
|
|
|
224
224
|
"B",
|
|
225
225
|
# remove unused imports
|
|
226
226
|
"F401",
|
|
227
|
+
# check for missing future annotations
|
|
228
|
+
"FA102",
|
|
227
229
|
# bare except statements
|
|
228
230
|
"E722",
|
|
229
231
|
# unused arguments
|
|
@@ -246,6 +248,8 @@ unfixable = [
|
|
|
246
248
|
"T203",
|
|
247
249
|
]
|
|
248
250
|
|
|
251
|
+
extend-safe-fixes = ["FA102"]
|
|
252
|
+
|
|
249
253
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
250
254
|
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
|
251
255
|
|
|
@@ -88,9 +88,9 @@ pluggy==1.5.0
|
|
|
88
88
|
propcache==0.3.1
|
|
89
89
|
# via aiohttp
|
|
90
90
|
# via yarl
|
|
91
|
-
pydantic==2.
|
|
91
|
+
pydantic==2.11.9
|
|
92
92
|
# via dataleon
|
|
93
|
-
pydantic-core==2.
|
|
93
|
+
pydantic-core==2.33.2
|
|
94
94
|
# via pydantic
|
|
95
95
|
pygments==2.18.0
|
|
96
96
|
# via rich
|
|
@@ -126,6 +126,9 @@ typing-extensions==4.12.2
|
|
|
126
126
|
# via pydantic
|
|
127
127
|
# via pydantic-core
|
|
128
128
|
# via pyright
|
|
129
|
+
# via typing-inspection
|
|
130
|
+
typing-inspection==0.4.1
|
|
131
|
+
# via pydantic
|
|
129
132
|
virtualenv==20.24.5
|
|
130
133
|
# via nox
|
|
131
134
|
yarl==1.20.0
|
|
@@ -55,9 +55,9 @@ multidict==6.4.4
|
|
|
55
55
|
propcache==0.3.1
|
|
56
56
|
# via aiohttp
|
|
57
57
|
# via yarl
|
|
58
|
-
pydantic==2.
|
|
58
|
+
pydantic==2.11.9
|
|
59
59
|
# via dataleon
|
|
60
|
-
pydantic-core==2.
|
|
60
|
+
pydantic-core==2.33.2
|
|
61
61
|
# via pydantic
|
|
62
62
|
sniffio==1.3.0
|
|
63
63
|
# via anyio
|
|
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
|
|
|
68
68
|
# via multidict
|
|
69
69
|
# via pydantic
|
|
70
70
|
# via pydantic-core
|
|
71
|
+
# via typing-inspection
|
|
72
|
+
typing-inspection==0.4.1
|
|
73
|
+
# via pydantic
|
|
71
74
|
yarl==1.20.0
|
|
72
75
|
# via aiohttp
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import typing as _t
|
|
4
4
|
|
|
5
5
|
from . import types
|
|
6
|
-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
|
6
|
+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
|
|
7
7
|
from ._utils import file_from_path
|
|
8
8
|
from ._client import (
|
|
9
9
|
Client,
|
|
@@ -48,7 +48,9 @@ __all__ = [
|
|
|
48
48
|
"ProxiesTypes",
|
|
49
49
|
"NotGiven",
|
|
50
50
|
"NOT_GIVEN",
|
|
51
|
+
"not_given",
|
|
51
52
|
"Omit",
|
|
53
|
+
"omit",
|
|
52
54
|
"DataleonError",
|
|
53
55
|
"APIError",
|
|
54
56
|
"APIStatusError",
|
|
@@ -42,7 +42,6 @@ from . import _exceptions
|
|
|
42
42
|
from ._qs import Querystring
|
|
43
43
|
from ._files import to_httpx_files, async_to_httpx_files
|
|
44
44
|
from ._types import (
|
|
45
|
-
NOT_GIVEN,
|
|
46
45
|
Body,
|
|
47
46
|
Omit,
|
|
48
47
|
Query,
|
|
@@ -57,6 +56,7 @@ from ._types import (
|
|
|
57
56
|
RequestOptions,
|
|
58
57
|
HttpxRequestFiles,
|
|
59
58
|
ModelBuilderProtocol,
|
|
59
|
+
not_given,
|
|
60
60
|
)
|
|
61
61
|
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
|
|
62
62
|
from ._compat import PYDANTIC_V1, model_copy, model_dump
|
|
@@ -145,9 +145,9 @@ class PageInfo:
|
|
|
145
145
|
def __init__(
|
|
146
146
|
self,
|
|
147
147
|
*,
|
|
148
|
-
url: URL | NotGiven =
|
|
149
|
-
json: Body | NotGiven =
|
|
150
|
-
params: Query | NotGiven =
|
|
148
|
+
url: URL | NotGiven = not_given,
|
|
149
|
+
json: Body | NotGiven = not_given,
|
|
150
|
+
params: Query | NotGiven = not_given,
|
|
151
151
|
) -> None:
|
|
152
152
|
self.url = url
|
|
153
153
|
self.json = json
|
|
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
595
595
|
# we internally support defining a temporary header to override the
|
|
596
596
|
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
|
|
597
597
|
# see _response.py for implementation details
|
|
598
|
-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER,
|
|
598
|
+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
|
|
599
599
|
if is_given(override_cast_to):
|
|
600
600
|
options.headers = headers
|
|
601
601
|
return cast(Type[ResponseT], override_cast_to)
|
|
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
825
825
|
version: str,
|
|
826
826
|
base_url: str | URL,
|
|
827
827
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
828
|
-
timeout: float | Timeout | None | NotGiven =
|
|
828
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
829
829
|
http_client: httpx.Client | None = None,
|
|
830
830
|
custom_headers: Mapping[str, str] | None = None,
|
|
831
831
|
custom_query: Mapping[str, object] | None = None,
|
|
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1356
1356
|
base_url: str | URL,
|
|
1357
1357
|
_strict_response_validation: bool,
|
|
1358
1358
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
1359
|
-
timeout: float | Timeout | None | NotGiven =
|
|
1359
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1360
1360
|
http_client: httpx.AsyncClient | None = None,
|
|
1361
1361
|
custom_headers: Mapping[str, str] | None = None,
|
|
1362
1362
|
custom_query: Mapping[str, object] | None = None,
|
|
@@ -1818,8 +1818,8 @@ def make_request_options(
|
|
|
1818
1818
|
extra_query: Query | None = None,
|
|
1819
1819
|
extra_body: Body | None = None,
|
|
1820
1820
|
idempotency_key: str | None = None,
|
|
1821
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1822
|
-
post_parser: PostParser | NotGiven =
|
|
1821
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1822
|
+
post_parser: PostParser | NotGiven = not_given,
|
|
1823
1823
|
) -> RequestOptions:
|
|
1824
1824
|
"""Create a dict of type RequestOptions without keys of NotGiven values."""
|
|
1825
1825
|
options: RequestOptions = {}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Mapping
|
|
7
7
|
from typing_extensions import Self, override
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
@@ -11,13 +11,13 @@ import httpx
|
|
|
11
11
|
from . import _exceptions
|
|
12
12
|
from ._qs import Querystring
|
|
13
13
|
from ._types import (
|
|
14
|
-
NOT_GIVEN,
|
|
15
14
|
Omit,
|
|
16
15
|
Timeout,
|
|
17
16
|
NotGiven,
|
|
18
17
|
Transport,
|
|
19
18
|
ProxiesTypes,
|
|
20
19
|
RequestOptions,
|
|
20
|
+
not_given,
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
23
|
from ._version import __version__
|
|
@@ -57,7 +57,7 @@ class Dataleon(SyncAPIClient):
|
|
|
57
57
|
*,
|
|
58
58
|
api_key: str | None = None,
|
|
59
59
|
base_url: str | httpx.URL | None = None,
|
|
60
|
-
timeout:
|
|
60
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
61
61
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
62
62
|
default_headers: Mapping[str, str] | None = None,
|
|
63
63
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -133,9 +133,9 @@ class Dataleon(SyncAPIClient):
|
|
|
133
133
|
*,
|
|
134
134
|
api_key: str | None = None,
|
|
135
135
|
base_url: str | httpx.URL | None = None,
|
|
136
|
-
timeout: float | Timeout | None | NotGiven =
|
|
136
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
137
137
|
http_client: httpx.Client | None = None,
|
|
138
|
-
max_retries: int | NotGiven =
|
|
138
|
+
max_retries: int | NotGiven = not_given,
|
|
139
139
|
default_headers: Mapping[str, str] | None = None,
|
|
140
140
|
set_default_headers: Mapping[str, str] | None = None,
|
|
141
141
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -227,7 +227,7 @@ class AsyncDataleon(AsyncAPIClient):
|
|
|
227
227
|
*,
|
|
228
228
|
api_key: str | None = None,
|
|
229
229
|
base_url: str | httpx.URL | None = None,
|
|
230
|
-
timeout:
|
|
230
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
231
231
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
232
232
|
default_headers: Mapping[str, str] | None = None,
|
|
233
233
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -303,9 +303,9 @@ class AsyncDataleon(AsyncAPIClient):
|
|
|
303
303
|
*,
|
|
304
304
|
api_key: str | None = None,
|
|
305
305
|
base_url: str | httpx.URL | None = None,
|
|
306
|
-
timeout: float | Timeout | None | NotGiven =
|
|
306
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
307
307
|
http_client: httpx.AsyncClient | None = None,
|
|
308
|
-
max_retries: int | NotGiven =
|
|
308
|
+
max_retries: int | NotGiven = not_given,
|
|
309
309
|
default_headers: Mapping[str, str] | None = None,
|
|
310
310
|
set_default_headers: Mapping[str, str] | None = None,
|
|
311
311
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -256,7 +256,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
256
256
|
mode: Literal["json", "python"] | str = "python",
|
|
257
257
|
include: IncEx | None = None,
|
|
258
258
|
exclude: IncEx | None = None,
|
|
259
|
-
by_alias: bool =
|
|
259
|
+
by_alias: bool | None = None,
|
|
260
260
|
exclude_unset: bool = False,
|
|
261
261
|
exclude_defaults: bool = False,
|
|
262
262
|
exclude_none: bool = False,
|
|
@@ -264,6 +264,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
264
264
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
265
265
|
context: dict[str, Any] | None = None,
|
|
266
266
|
serialize_as_any: bool = False,
|
|
267
|
+
fallback: Callable[[Any], Any] | None = None,
|
|
267
268
|
) -> dict[str, Any]:
|
|
268
269
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
|
|
269
270
|
|
|
@@ -295,10 +296,12 @@ class BaseModel(pydantic.BaseModel):
|
|
|
295
296
|
raise ValueError("context is only supported in Pydantic v2")
|
|
296
297
|
if serialize_as_any != False:
|
|
297
298
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
299
|
+
if fallback is not None:
|
|
300
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
|
298
301
|
dumped = super().dict( # pyright: ignore[reportDeprecated]
|
|
299
302
|
include=include,
|
|
300
303
|
exclude=exclude,
|
|
301
|
-
by_alias=by_alias,
|
|
304
|
+
by_alias=by_alias if by_alias is not None else False,
|
|
302
305
|
exclude_unset=exclude_unset,
|
|
303
306
|
exclude_defaults=exclude_defaults,
|
|
304
307
|
exclude_none=exclude_none,
|
|
@@ -313,13 +316,14 @@ class BaseModel(pydantic.BaseModel):
|
|
|
313
316
|
indent: int | None = None,
|
|
314
317
|
include: IncEx | None = None,
|
|
315
318
|
exclude: IncEx | None = None,
|
|
316
|
-
by_alias: bool =
|
|
319
|
+
by_alias: bool | None = None,
|
|
317
320
|
exclude_unset: bool = False,
|
|
318
321
|
exclude_defaults: bool = False,
|
|
319
322
|
exclude_none: bool = False,
|
|
320
323
|
round_trip: bool = False,
|
|
321
324
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
322
325
|
context: dict[str, Any] | None = None,
|
|
326
|
+
fallback: Callable[[Any], Any] | None = None,
|
|
323
327
|
serialize_as_any: bool = False,
|
|
324
328
|
) -> str:
|
|
325
329
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
|
|
@@ -348,11 +352,13 @@ class BaseModel(pydantic.BaseModel):
|
|
|
348
352
|
raise ValueError("context is only supported in Pydantic v2")
|
|
349
353
|
if serialize_as_any != False:
|
|
350
354
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
355
|
+
if fallback is not None:
|
|
356
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
|
351
357
|
return super().json( # type: ignore[reportDeprecated]
|
|
352
358
|
indent=indent,
|
|
353
359
|
include=include,
|
|
354
360
|
exclude=exclude,
|
|
355
|
-
by_alias=by_alias,
|
|
361
|
+
by_alias=by_alias if by_alias is not None else False,
|
|
356
362
|
exclude_unset=exclude_unset,
|
|
357
363
|
exclude_defaults=exclude_defaults,
|
|
358
364
|
exclude_none=exclude_none,
|
|
@@ -4,7 +4,7 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar
|
|
|
4
4
|
from urllib.parse import parse_qs, urlencode
|
|
5
5
|
from typing_extensions import Literal, get_args
|
|
6
6
|
|
|
7
|
-
from ._types import
|
|
7
|
+
from ._types import NotGiven, not_given
|
|
8
8
|
from ._utils import flatten
|
|
9
9
|
|
|
10
10
|
_T = TypeVar("_T")
|
|
@@ -41,8 +41,8 @@ class Querystring:
|
|
|
41
41
|
self,
|
|
42
42
|
params: Params,
|
|
43
43
|
*,
|
|
44
|
-
array_format:
|
|
45
|
-
nested_format:
|
|
44
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
45
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
46
46
|
) -> str:
|
|
47
47
|
return urlencode(
|
|
48
48
|
self.stringify_items(
|
|
@@ -56,8 +56,8 @@ class Querystring:
|
|
|
56
56
|
self,
|
|
57
57
|
params: Params,
|
|
58
58
|
*,
|
|
59
|
-
array_format:
|
|
60
|
-
nested_format:
|
|
59
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
60
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
61
61
|
) -> list[tuple[str, str]]:
|
|
62
62
|
opts = Options(
|
|
63
63
|
qs=self,
|
|
@@ -143,8 +143,8 @@ class Options:
|
|
|
143
143
|
self,
|
|
144
144
|
qs: Querystring = _qs,
|
|
145
145
|
*,
|
|
146
|
-
array_format:
|
|
147
|
-
nested_format:
|
|
146
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
147
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
148
148
|
) -> None:
|
|
149
149
|
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
|
|
150
150
|
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
|
|
@@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
|
|
|
117
117
|
# Sentinel class used until PEP 0661 is accepted
|
|
118
118
|
class NotGiven:
|
|
119
119
|
"""
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
For parameters with a meaningful None value, we need to distinguish between
|
|
121
|
+
the user explicitly passing None, and the user not passing the parameter at
|
|
122
|
+
all.
|
|
123
|
+
|
|
124
|
+
User code shouldn't need to use not_given directly.
|
|
122
125
|
|
|
123
126
|
For example:
|
|
124
127
|
|
|
125
128
|
```py
|
|
126
|
-
def
|
|
129
|
+
def create(timeout: Timeout | None | NotGiven = not_given): ...
|
|
127
130
|
|
|
128
131
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
create(timeout=1) # 1s timeout
|
|
133
|
+
create(timeout=None) # No timeout
|
|
134
|
+
create() # Default timeout behavior
|
|
132
135
|
```
|
|
133
136
|
"""
|
|
134
137
|
|
|
@@ -140,13 +143,14 @@ class NotGiven:
|
|
|
140
143
|
return "NOT_GIVEN"
|
|
141
144
|
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
not_given = NotGiven()
|
|
147
|
+
# for backwards compatibility:
|
|
144
148
|
NOT_GIVEN = NotGiven()
|
|
145
149
|
|
|
146
150
|
|
|
147
151
|
class Omit:
|
|
148
|
-
"""
|
|
149
|
-
|
|
152
|
+
"""
|
|
153
|
+
To explicitly omit something from being sent in a request, use `omit`.
|
|
150
154
|
|
|
151
155
|
```py
|
|
152
156
|
# as the default `Content-Type` header is `application/json` that will be sent
|
|
@@ -156,8 +160,8 @@ class Omit:
|
|
|
156
160
|
# to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
|
|
157
161
|
client.post(..., headers={"Content-Type": "multipart/form-data"})
|
|
158
162
|
|
|
159
|
-
# instead you can remove the default `application/json` header by passing
|
|
160
|
-
client.post(..., headers={"Content-Type":
|
|
163
|
+
# instead you can remove the default `application/json` header by passing omit
|
|
164
|
+
client.post(..., headers={"Content-Type": omit})
|
|
161
165
|
```
|
|
162
166
|
"""
|
|
163
167
|
|
|
@@ -165,6 +169,9 @@ class Omit:
|
|
|
165
169
|
return False
|
|
166
170
|
|
|
167
171
|
|
|
172
|
+
omit = Omit()
|
|
173
|
+
|
|
174
|
+
|
|
168
175
|
@runtime_checkable
|
|
169
176
|
class ModelBuilderProtocol(Protocol):
|
|
170
177
|
@classmethod
|
|
@@ -268,7 +268,7 @@ def _transform_typeddict(
|
|
|
268
268
|
annotations = get_type_hints(expected_type, include_extras=True)
|
|
269
269
|
for key, value in data.items():
|
|
270
270
|
if not is_given(value):
|
|
271
|
-
# we don't need to include
|
|
271
|
+
# we don't need to include omitted values here as they'll
|
|
272
272
|
# be stripped out before the request is sent anyway
|
|
273
273
|
continue
|
|
274
274
|
|
|
@@ -434,7 +434,7 @@ async def _async_transform_typeddict(
|
|
|
434
434
|
annotations = get_type_hints(expected_type, include_extras=True)
|
|
435
435
|
for key, value in data.items():
|
|
436
436
|
if not is_given(value):
|
|
437
|
-
# we don't need to include
|
|
437
|
+
# we don't need to include omitted values here as they'll
|
|
438
438
|
# be stripped out before the request is sent anyway
|
|
439
439
|
continue
|
|
440
440
|
|
|
@@ -21,7 +21,7 @@ from typing_extensions import TypeGuard
|
|
|
21
21
|
|
|
22
22
|
import sniffio
|
|
23
23
|
|
|
24
|
-
from .._types import NotGiven, FileTypes,
|
|
24
|
+
from .._types import Omit, NotGiven, FileTypes, HeadersLike
|
|
25
25
|
|
|
26
26
|
_T = TypeVar("_T")
|
|
27
27
|
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
|
|
@@ -63,7 +63,7 @@ def _extract_items(
|
|
|
63
63
|
try:
|
|
64
64
|
key = path[index]
|
|
65
65
|
except IndexError:
|
|
66
|
-
if
|
|
66
|
+
if not is_given(obj):
|
|
67
67
|
# no value was provided - we can safely ignore
|
|
68
68
|
return []
|
|
69
69
|
|
|
@@ -126,8 +126,8 @@ def _extract_items(
|
|
|
126
126
|
return []
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
def is_given(obj:
|
|
130
|
-
return not isinstance(obj, NotGiven)
|
|
129
|
+
def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
130
|
+
return not isinstance(obj, NotGiven) and not isinstance(obj, Omit)
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|