dataleon 0.1.0a5__tar.gz → 0.1.0a8__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 dataleon might be problematic. Click here for more details.
- dataleon-0.1.0a8/.release-please-manifest.json +3 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/CHANGELOG.md +41 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/PKG-INFO +5 -6
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/README.md +2 -2
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/pyproject.toml +8 -5
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/requirements-dev.lock +1 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/requirements.lock +1 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_models.py +8 -3
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_streaming.py +4 -6
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_sync.py +3 -31
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_utils.py +1 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_version.py +1 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_create_params.py +5 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_registration.py +5 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_update_params.py +5 -1
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual.py +5 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual_create_params.py +4 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual_update_params.py +4 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/test_companies.py +4 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/test_individuals.py +4 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_client.py +198 -164
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_models.py +4 -4
- dataleon-0.1.0a5/.release-please-manifest.json +0 -3
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/.gitignore +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/CONTRIBUTING.md +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/LICENSE +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/SECURITY.md +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/api.md +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/bin/check-release-environment +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/bin/publish-pypi +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/examples/.keep +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/noxfile.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/release-please-config.json +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_base_client.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_client.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_compat.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_constants.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_exceptions.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_files.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_qs.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_resource.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_response.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_types.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_compat.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_datetime_parse.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_logs.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_proxy.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_reflection.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_resources_proxy.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_streams.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_transform.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/_utils/_typing.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/lib/.keep +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/py.typed +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/companies/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/companies/companies.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/companies/documents.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/documents.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/individuals.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/companies/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/companies/document_upload_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_list_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_list_response.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/company_retrieve_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual_list_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual_list_response.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individual_retrieve_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individuals/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individuals/document_response.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individuals/document_upload_params.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/individuals/generic_document.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/shared/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/src/dataleon/types/shared/check.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/companies/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/companies/test_documents.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/individuals/__init__.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/api_resources/individuals/test_documents.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/conftest.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/sample_file.txt +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_deepcopy.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_extract_files.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_files.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_qs.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_required_args.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_response.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_streaming.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_transform.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_utils/test_datetime_parse.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_utils/test_proxy.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/test_utils/test_typing.py +0 -0
- {dataleon-0.1.0a5 → dataleon-0.1.0a8}/tests/utils.py +0 -0
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.8 (2025-11-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/dataleonlabs/dataleon-python/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* compat with Python 3.14 ([87a4a57](https://github.com/dataleonlabs/dataleon-python/commit/87a4a579ec5d3933a87a7d3c4b94ba97191aa5b8))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal/tests:** avoid race condition with implicit client cleanup ([16a7270](https://github.com/dataleonlabs/dataleon-python/commit/16a72708bc147c733854ad05e62d5225f79290bd))
|
|
15
|
+
* **internal:** grammar fix (it's -> its) ([0d337f6](https://github.com/dataleonlabs/dataleon-python/commit/0d337f6a8784093bf9fde3c7136ad94d55e315d9))
|
|
16
|
+
* **package:** drop Python 3.8 support ([8ba1eb6](https://github.com/dataleonlabs/dataleon-python/commit/8ba1eb66b3335afc842a7036cac2116d7b699945))
|
|
17
|
+
|
|
18
|
+
## 0.1.0-alpha.7 (2025-10-30)
|
|
19
|
+
|
|
20
|
+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/dataleonlabs/dataleon-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **client:** close streams without requiring full consumption ([48f0100](https://github.com/dataleonlabs/dataleon-python/commit/48f01007da66b137cb540a577b77cb99839c0f14))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Chores
|
|
28
|
+
|
|
29
|
+
* bump `httpx-aiohttp` version to 0.1.9 ([a2d5e8b](https://github.com/dataleonlabs/dataleon-python/commit/a2d5e8b6e27e5b3f2bf3815ee9dbe0e5b68afc93))
|
|
30
|
+
|
|
31
|
+
## 0.1.0-alpha.6 (2025-10-14)
|
|
32
|
+
|
|
33
|
+
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)
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* **api:** api update ([5e6943f](https://github.com/dataleonlabs/dataleon-python/commit/5e6943fc5724b9bf19cb8958b6d06f4b0abefcaf))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Chores
|
|
41
|
+
|
|
42
|
+
* **internal:** detect missing future annotations with ruff ([7ed7019](https://github.com/dataleonlabs/dataleon-python/commit/7ed7019f18938d0b0ac99c18478696bb352dfd63))
|
|
43
|
+
|
|
3
44
|
## 0.1.0-alpha.5 (2025-09-20)
|
|
4
45
|
|
|
5
46
|
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)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dataleon
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a8
|
|
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
|
|
@@ -13,7 +13,6 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Operating System :: POSIX
|
|
15
15
|
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -21,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
22
|
Classifier: Typing :: Typed
|
|
24
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
25
24
|
Requires-Dist: anyio<5,>=3.5.0
|
|
26
25
|
Requires-Dist: distro<2,>=1.7.0
|
|
27
26
|
Requires-Dist: httpx<1,>=0.23.0
|
|
@@ -30,7 +29,7 @@ Requires-Dist: sniffio
|
|
|
30
29
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
30
|
Provides-Extra: aiohttp
|
|
32
31
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
-
Requires-Dist: httpx-aiohttp>=0.1.
|
|
32
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
33
|
Description-Content-Type: text/markdown
|
|
35
34
|
|
|
36
35
|
# Dataleon Python API library
|
|
@@ -38,7 +37,7 @@ Description-Content-Type: text/markdown
|
|
|
38
37
|
<!-- prettier-ignore -->
|
|
39
38
|
[)](https://pypi.org/project/dataleon/)
|
|
40
39
|
|
|
41
|
-
The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.
|
|
40
|
+
The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.9+
|
|
42
41
|
application. The library includes type definitions for all request params and response fields,
|
|
43
42
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
44
43
|
|
|
@@ -442,7 +441,7 @@ print(dataleon.__version__)
|
|
|
442
441
|
|
|
443
442
|
## Requirements
|
|
444
443
|
|
|
445
|
-
Python 3.
|
|
444
|
+
Python 3.9 or higher.
|
|
446
445
|
|
|
447
446
|
## Contributing
|
|
448
447
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- prettier-ignore -->
|
|
4
4
|
[)](https://pypi.org/project/dataleon/)
|
|
5
5
|
|
|
6
|
-
The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.
|
|
6
|
+
The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.9+
|
|
7
7
|
application. The library includes type definitions for all request params and response fields,
|
|
8
8
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
9
9
|
|
|
@@ -407,7 +407,7 @@ print(dataleon.__version__)
|
|
|
407
407
|
|
|
408
408
|
## Requirements
|
|
409
409
|
|
|
410
|
-
Python 3.
|
|
410
|
+
Python 3.9 or higher.
|
|
411
411
|
|
|
412
412
|
## Contributing
|
|
413
413
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dataleon"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.8"
|
|
4
4
|
description = "The official Python library for the dataleon API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -15,11 +15,10 @@ dependencies = [
|
|
|
15
15
|
"distro>=1.7.0, <2",
|
|
16
16
|
"sniffio",
|
|
17
17
|
]
|
|
18
|
-
requires-python = ">= 3.
|
|
18
|
+
requires-python = ">= 3.9"
|
|
19
19
|
classifiers = [
|
|
20
20
|
"Typing :: Typed",
|
|
21
21
|
"Intended Audience :: Developers",
|
|
22
|
-
"Programming Language :: Python :: 3.8",
|
|
23
22
|
"Programming Language :: Python :: 3.9",
|
|
24
23
|
"Programming Language :: Python :: 3.10",
|
|
25
24
|
"Programming Language :: Python :: 3.11",
|
|
@@ -39,7 +38,7 @@ Homepage = "https://github.com/dataleonlabs/dataleon-python"
|
|
|
39
38
|
Repository = "https://github.com/dataleonlabs/dataleon-python"
|
|
40
39
|
|
|
41
40
|
[project.optional-dependencies]
|
|
42
|
-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.
|
|
41
|
+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
|
|
43
42
|
|
|
44
43
|
[tool.rye]
|
|
45
44
|
managed = true
|
|
@@ -141,7 +140,7 @@ filterwarnings = [
|
|
|
141
140
|
# there are a couple of flags that are still disabled by
|
|
142
141
|
# default in strict mode as they are experimental and niche.
|
|
143
142
|
typeCheckingMode = "strict"
|
|
144
|
-
pythonVersion = "3.
|
|
143
|
+
pythonVersion = "3.9"
|
|
145
144
|
|
|
146
145
|
exclude = [
|
|
147
146
|
"_dev",
|
|
@@ -224,6 +223,8 @@ select = [
|
|
|
224
223
|
"B",
|
|
225
224
|
# remove unused imports
|
|
226
225
|
"F401",
|
|
226
|
+
# check for missing future annotations
|
|
227
|
+
"FA102",
|
|
227
228
|
# bare except statements
|
|
228
229
|
"E722",
|
|
229
230
|
# unused arguments
|
|
@@ -246,6 +247,8 @@ unfixable = [
|
|
|
246
247
|
"T203",
|
|
247
248
|
]
|
|
248
249
|
|
|
250
|
+
extend-safe-fixes = ["FA102"]
|
|
251
|
+
|
|
249
252
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
250
253
|
"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
254
|
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import inspect
|
|
5
|
+
import weakref
|
|
5
6
|
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
|
|
6
7
|
from datetime import date, datetime
|
|
7
8
|
from typing_extensions import (
|
|
@@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol):
|
|
|
573
574
|
__discriminator__: DiscriminatorDetails
|
|
574
575
|
|
|
575
576
|
|
|
577
|
+
DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary()
|
|
578
|
+
|
|
579
|
+
|
|
576
580
|
class DiscriminatorDetails:
|
|
577
581
|
field_name: str
|
|
578
582
|
"""The name of the discriminator field in the variant class, e.g.
|
|
@@ -615,8 +619,9 @@ class DiscriminatorDetails:
|
|
|
615
619
|
|
|
616
620
|
|
|
617
621
|
def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None:
|
|
618
|
-
|
|
619
|
-
|
|
622
|
+
cached = DISCRIMINATOR_CACHE.get(union)
|
|
623
|
+
if cached is not None:
|
|
624
|
+
return cached
|
|
620
625
|
|
|
621
626
|
discriminator_field_name: str | None = None
|
|
622
627
|
|
|
@@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|
|
669
674
|
discriminator_field=discriminator_field_name,
|
|
670
675
|
discriminator_alias=discriminator_alias,
|
|
671
676
|
)
|
|
672
|
-
|
|
677
|
+
DISCRIMINATOR_CACHE.setdefault(union, details)
|
|
673
678
|
return details
|
|
674
679
|
|
|
675
680
|
|
|
@@ -57,9 +57,8 @@ class Stream(Generic[_T]):
|
|
|
57
57
|
for sse in iterator:
|
|
58
58
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
59
59
|
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
...
|
|
60
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
61
|
+
response.close()
|
|
63
62
|
|
|
64
63
|
def __enter__(self) -> Self:
|
|
65
64
|
return self
|
|
@@ -121,9 +120,8 @@ class AsyncStream(Generic[_T]):
|
|
|
121
120
|
async for sse in iterator:
|
|
122
121
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
123
122
|
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
...
|
|
123
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
124
|
+
await response.aclose()
|
|
127
125
|
|
|
128
126
|
async def __aenter__(self) -> Self:
|
|
129
127
|
return self
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import sys
|
|
4
3
|
import asyncio
|
|
5
4
|
import functools
|
|
6
|
-
import
|
|
7
|
-
from typing import Any, TypeVar, Callable, Awaitable
|
|
5
|
+
from typing import TypeVar, Callable, Awaitable
|
|
8
6
|
from typing_extensions import ParamSpec
|
|
9
7
|
|
|
10
8
|
import anyio
|
|
@@ -15,34 +13,11 @@ T_Retval = TypeVar("T_Retval")
|
|
|
15
13
|
T_ParamSpec = ParamSpec("T_ParamSpec")
|
|
16
14
|
|
|
17
15
|
|
|
18
|
-
if sys.version_info >= (3, 9):
|
|
19
|
-
_asyncio_to_thread = asyncio.to_thread
|
|
20
|
-
else:
|
|
21
|
-
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
|
22
|
-
# for Python 3.8 support
|
|
23
|
-
async def _asyncio_to_thread(
|
|
24
|
-
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
25
|
-
) -> Any:
|
|
26
|
-
"""Asynchronously run function *func* in a separate thread.
|
|
27
|
-
|
|
28
|
-
Any *args and **kwargs supplied for this function are directly passed
|
|
29
|
-
to *func*. Also, the current :class:`contextvars.Context` is propagated,
|
|
30
|
-
allowing context variables from the main thread to be accessed in the
|
|
31
|
-
separate thread.
|
|
32
|
-
|
|
33
|
-
Returns a coroutine that can be awaited to get the eventual result of *func*.
|
|
34
|
-
"""
|
|
35
|
-
loop = asyncio.events.get_running_loop()
|
|
36
|
-
ctx = contextvars.copy_context()
|
|
37
|
-
func_call = functools.partial(ctx.run, func, *args, **kwargs)
|
|
38
|
-
return await loop.run_in_executor(None, func_call)
|
|
39
|
-
|
|
40
|
-
|
|
41
16
|
async def to_thread(
|
|
42
17
|
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
43
18
|
) -> T_Retval:
|
|
44
19
|
if sniffio.current_async_library() == "asyncio":
|
|
45
|
-
return await
|
|
20
|
+
return await asyncio.to_thread(func, *args, **kwargs)
|
|
46
21
|
|
|
47
22
|
return await anyio.to_thread.run_sync(
|
|
48
23
|
functools.partial(func, *args, **kwargs),
|
|
@@ -53,10 +28,7 @@ async def to_thread(
|
|
|
53
28
|
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
|
54
29
|
"""
|
|
55
30
|
Take a blocking function and create an async one that receives the same
|
|
56
|
-
positional and keyword arguments.
|
|
57
|
-
asyncio.to_thread to run the function in a separate thread. For python version
|
|
58
|
-
3.8, it uses locally defined copy of the asyncio.to_thread function which was
|
|
59
|
-
introduced in python 3.9.
|
|
31
|
+
positional and keyword arguments.
|
|
60
32
|
|
|
61
33
|
Usage:
|
|
62
34
|
|
|
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
|
134
134
|
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
|
|
135
135
|
# however this cause Pyright to rightfully report errors. As we know we don't
|
|
136
|
-
# care about the contained types we can safely use `object` in
|
|
136
|
+
# care about the contained types we can safely use `object` in its place.
|
|
137
137
|
#
|
|
138
138
|
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
|
|
139
139
|
# `is_*` is for when you're dealing with an unknown input
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
7
|
|
|
7
8
|
__all__ = ["CompanyCreateParams", "Company", "TechnicalData"]
|
|
8
9
|
|
|
@@ -93,5 +94,8 @@ class TechnicalData(TypedDict, total=False):
|
|
|
93
94
|
language: str
|
|
94
95
|
"""Preferred language for responses or notifications (e.g., "eng", "fra")."""
|
|
95
96
|
|
|
97
|
+
portal_steps: List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
98
|
+
"""List of steps to include in the portal workflow."""
|
|
99
|
+
|
|
96
100
|
raw_data: bool
|
|
97
101
|
"""Flag indicating whether to include raw data in the response."""
|
|
@@ -338,6 +338,11 @@ class TechnicalData(BaseModel):
|
|
|
338
338
|
notification_confirmation: Optional[bool] = None
|
|
339
339
|
"""Flag indicating if notification confirmation is required or received."""
|
|
340
340
|
|
|
341
|
+
portal_steps: Optional[
|
|
342
|
+
List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
343
|
+
] = None
|
|
344
|
+
"""List of steps to include in the portal workflow."""
|
|
345
|
+
|
|
341
346
|
qr_code: Optional[str] = None
|
|
342
347
|
"""Indicates whether QR code is enabled ("true" or "false")."""
|
|
343
348
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
7
|
|
|
7
8
|
__all__ = ["CompanyUpdateParams", "Company", "TechnicalData"]
|
|
8
9
|
|
|
@@ -93,5 +94,8 @@ class TechnicalData(TypedDict, total=False):
|
|
|
93
94
|
language: str
|
|
94
95
|
"""Preferred language for responses or notifications (e.g., "eng", "fra")."""
|
|
95
96
|
|
|
97
|
+
portal_steps: List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
98
|
+
"""List of steps to include in the portal workflow."""
|
|
99
|
+
|
|
96
100
|
raw_data: bool
|
|
97
101
|
"""Flag indicating whether to include raw data in the response."""
|
|
@@ -236,6 +236,11 @@ class TechnicalData(BaseModel):
|
|
|
236
236
|
notification_confirmation: Optional[bool] = None
|
|
237
237
|
"""Flag indicating if notification confirmation is required or received."""
|
|
238
238
|
|
|
239
|
+
portal_steps: Optional[
|
|
240
|
+
List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
241
|
+
] = None
|
|
242
|
+
"""List of steps to include in the portal workflow."""
|
|
243
|
+
|
|
239
244
|
qr_code: Optional[str] = None
|
|
240
245
|
"""Indicates whether QR code is enabled ("true" or "false")."""
|
|
241
246
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing import List
|
|
5
6
|
from typing_extensions import Literal, Required, TypedDict
|
|
6
7
|
|
|
7
8
|
__all__ = ["IndividualCreateParams", "Person", "TechnicalData"]
|
|
@@ -70,5 +71,8 @@ class TechnicalData(TypedDict, total=False):
|
|
|
70
71
|
language: str
|
|
71
72
|
"""Preferred language for communication (e.g., "eng", "fra")."""
|
|
72
73
|
|
|
74
|
+
portal_steps: List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
75
|
+
"""List of steps to include in the portal workflow."""
|
|
76
|
+
|
|
73
77
|
raw_data: bool
|
|
74
78
|
"""Flag indicating whether to include raw data in the response."""
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing import List
|
|
5
6
|
from typing_extensions import Literal, Required, TypedDict
|
|
6
7
|
|
|
7
8
|
__all__ = ["IndividualUpdateParams", "Person", "TechnicalData"]
|
|
@@ -70,5 +71,8 @@ class TechnicalData(TypedDict, total=False):
|
|
|
70
71
|
language: str
|
|
71
72
|
"""Preferred language for communication (e.g., "eng", "fra")."""
|
|
72
73
|
|
|
74
|
+
portal_steps: List[Literal["identity_verification", "document_signing", "proof_of_address", "selfie", "face_match"]]
|
|
75
|
+
"""List of steps to include in the portal workflow."""
|
|
76
|
+
|
|
73
77
|
raw_data: bool
|
|
74
78
|
"""Flag indicating whether to include raw data in the response."""
|
|
@@ -59,6 +59,7 @@ class TestCompanies:
|
|
|
59
59
|
"callback_url_notification": "https://example.com/notify",
|
|
60
60
|
"filtering_score_aml_suspicions": 0.75,
|
|
61
61
|
"language": "fra",
|
|
62
|
+
"portal_steps": ["identity_verification", "document_signing"],
|
|
62
63
|
"raw_data": True,
|
|
63
64
|
},
|
|
64
65
|
)
|
|
@@ -184,6 +185,7 @@ class TestCompanies:
|
|
|
184
185
|
"callback_url_notification": "https://example.com/notify",
|
|
185
186
|
"filtering_score_aml_suspicions": 0.75,
|
|
186
187
|
"language": "fra",
|
|
188
|
+
"portal_steps": ["identity_verification", "document_signing"],
|
|
187
189
|
"raw_data": True,
|
|
188
190
|
},
|
|
189
191
|
)
|
|
@@ -358,6 +360,7 @@ class TestAsyncCompanies:
|
|
|
358
360
|
"callback_url_notification": "https://example.com/notify",
|
|
359
361
|
"filtering_score_aml_suspicions": 0.75,
|
|
360
362
|
"language": "fra",
|
|
363
|
+
"portal_steps": ["identity_verification", "document_signing"],
|
|
361
364
|
"raw_data": True,
|
|
362
365
|
},
|
|
363
366
|
)
|
|
@@ -483,6 +486,7 @@ class TestAsyncCompanies:
|
|
|
483
486
|
"callback_url_notification": "https://example.com/notify",
|
|
484
487
|
"filtering_score_aml_suspicions": 0.75,
|
|
485
488
|
"language": "fra",
|
|
489
|
+
"portal_steps": ["identity_verification", "document_signing"],
|
|
486
490
|
"raw_data": True,
|
|
487
491
|
},
|
|
488
492
|
)
|
|
@@ -51,6 +51,7 @@ class TestIndividuals:
|
|
|
51
51
|
"callback_url_notification": "https://example.com/notify",
|
|
52
52
|
"filtering_score_aml_suspicions": 0.75,
|
|
53
53
|
"language": "fra",
|
|
54
|
+
"portal_steps": ["identity_verification", "selfie", "face_match"],
|
|
54
55
|
"raw_data": True,
|
|
55
56
|
},
|
|
56
57
|
)
|
|
@@ -166,6 +167,7 @@ class TestIndividuals:
|
|
|
166
167
|
"callback_url_notification": "https://example.com/notify",
|
|
167
168
|
"filtering_score_aml_suspicions": 0.75,
|
|
168
169
|
"language": "fra",
|
|
170
|
+
"portal_steps": ["identity_verification", "selfie", "face_match"],
|
|
169
171
|
"raw_data": True,
|
|
170
172
|
},
|
|
171
173
|
)
|
|
@@ -329,6 +331,7 @@ class TestAsyncIndividuals:
|
|
|
329
331
|
"callback_url_notification": "https://example.com/notify",
|
|
330
332
|
"filtering_score_aml_suspicions": 0.75,
|
|
331
333
|
"language": "fra",
|
|
334
|
+
"portal_steps": ["identity_verification", "selfie", "face_match"],
|
|
332
335
|
"raw_data": True,
|
|
333
336
|
},
|
|
334
337
|
)
|
|
@@ -444,6 +447,7 @@ class TestAsyncIndividuals:
|
|
|
444
447
|
"callback_url_notification": "https://example.com/notify",
|
|
445
448
|
"filtering_score_aml_suspicions": 0.75,
|
|
446
449
|
"language": "fra",
|
|
450
|
+
"portal_steps": ["identity_verification", "selfie", "face_match"],
|
|
447
451
|
"raw_data": True,
|
|
448
452
|
},
|
|
449
453
|
)
|