dataleon 0.1.0a7__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.

Files changed (98) hide show
  1. dataleon-0.1.0a8/.release-please-manifest.json +3 -0
  2. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/CHANGELOG.md +15 -0
  3. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/PKG-INFO +4 -5
  4. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/README.md +2 -2
  5. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/pyproject.toml +3 -4
  6. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_models.py +8 -3
  7. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_sync.py +3 -31
  8. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_utils.py +1 -1
  9. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_version.py +1 -1
  10. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_client.py +198 -164
  11. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_models.py +4 -4
  12. dataleon-0.1.0a7/.release-please-manifest.json +0 -3
  13. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/.gitignore +0 -0
  14. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/CONTRIBUTING.md +0 -0
  15. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/LICENSE +0 -0
  16. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/SECURITY.md +0 -0
  17. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/api.md +0 -0
  18. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/bin/check-release-environment +0 -0
  19. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/bin/publish-pypi +0 -0
  20. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/examples/.keep +0 -0
  21. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/noxfile.py +0 -0
  22. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/release-please-config.json +0 -0
  23. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/requirements-dev.lock +0 -0
  24. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/requirements.lock +0 -0
  25. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/__init__.py +0 -0
  26. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_base_client.py +0 -0
  27. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_client.py +0 -0
  28. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_compat.py +0 -0
  29. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_constants.py +0 -0
  30. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_exceptions.py +0 -0
  31. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_files.py +0 -0
  32. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_qs.py +0 -0
  33. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_resource.py +0 -0
  34. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_response.py +0 -0
  35. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_streaming.py +0 -0
  36. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_types.py +0 -0
  37. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/__init__.py +0 -0
  38. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_compat.py +0 -0
  39. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_datetime_parse.py +0 -0
  40. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_logs.py +0 -0
  41. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_proxy.py +0 -0
  42. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_reflection.py +0 -0
  43. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_resources_proxy.py +0 -0
  44. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_streams.py +0 -0
  45. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_transform.py +0 -0
  46. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/_utils/_typing.py +0 -0
  47. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/lib/.keep +0 -0
  48. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/py.typed +0 -0
  49. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/__init__.py +0 -0
  50. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/companies/__init__.py +0 -0
  51. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/companies/companies.py +0 -0
  52. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/companies/documents.py +0 -0
  53. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/__init__.py +0 -0
  54. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/documents.py +0 -0
  55. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/resources/individuals/individuals.py +0 -0
  56. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/__init__.py +0 -0
  57. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/companies/__init__.py +0 -0
  58. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/companies/document_upload_params.py +0 -0
  59. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_create_params.py +0 -0
  60. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_list_params.py +0 -0
  61. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_list_response.py +0 -0
  62. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_registration.py +0 -0
  63. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_retrieve_params.py +0 -0
  64. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/company_update_params.py +0 -0
  65. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual.py +0 -0
  66. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual_create_params.py +0 -0
  67. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual_list_params.py +0 -0
  68. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual_list_response.py +0 -0
  69. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual_retrieve_params.py +0 -0
  70. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individual_update_params.py +0 -0
  71. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individuals/__init__.py +0 -0
  72. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individuals/document_response.py +0 -0
  73. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individuals/document_upload_params.py +0 -0
  74. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/individuals/generic_document.py +0 -0
  75. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/shared/__init__.py +0 -0
  76. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/src/dataleon/types/shared/check.py +0 -0
  77. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/__init__.py +0 -0
  78. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/__init__.py +0 -0
  79. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/companies/__init__.py +0 -0
  80. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/companies/test_documents.py +0 -0
  81. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/individuals/__init__.py +0 -0
  82. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/individuals/test_documents.py +0 -0
  83. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/test_companies.py +0 -0
  84. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/api_resources/test_individuals.py +0 -0
  85. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/conftest.py +0 -0
  86. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/sample_file.txt +0 -0
  87. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_deepcopy.py +0 -0
  88. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_extract_files.py +0 -0
  89. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_files.py +0 -0
  90. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_qs.py +0 -0
  91. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_required_args.py +0 -0
  92. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_response.py +0 -0
  93. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_streaming.py +0 -0
  94. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_transform.py +0 -0
  95. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_utils/test_datetime_parse.py +0 -0
  96. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_utils/test_proxy.py +0 -0
  97. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/test_utils/test_typing.py +0 -0
  98. {dataleon-0.1.0a7 → dataleon-0.1.0a8}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0-alpha.8"
3
+ }
@@ -1,5 +1,20 @@
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
+
3
18
  ## 0.1.0-alpha.7 (2025-10-30)
4
19
 
5
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dataleon
3
- Version: 0.1.0a7
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.8
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
@@ -38,7 +37,7 @@ Description-Content-Type: text/markdown
38
37
  <!-- prettier-ignore -->
39
38
  [![PyPI version](https://img.shields.io/pypi/v/dataleon.svg?label=pypi%20(stable))](https://pypi.org/project/dataleon/)
40
39
 
41
- The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.8+
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.8 or higher.
444
+ Python 3.9 or higher.
446
445
 
447
446
  ## Contributing
448
447
 
@@ -3,7 +3,7 @@
3
3
  <!-- prettier-ignore -->
4
4
  [![PyPI version](https://img.shields.io/pypi/v/dataleon.svg?label=pypi%20(stable))](https://pypi.org/project/dataleon/)
5
5
 
6
- The Dataleon Python library provides convenient access to the Dataleon REST API from any Python 3.8+
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.8 or higher.
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.7"
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.8"
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",
@@ -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.8"
143
+ pythonVersion = "3.9"
145
144
 
146
145
  exclude = [
147
146
  "_dev",
@@ -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
- if isinstance(union, CachedDiscriminatorType):
619
- return union.__discriminator__
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
- cast(CachedDiscriminatorType, union).__discriminator__ = details
677
+ DISCRIMINATOR_CACHE.setdefault(union, details)
673
678
  return details
674
679
 
675
680
 
@@ -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 contextvars
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 _asyncio_to_thread(func, *args, **kwargs)
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. For python version 3.9 and above, it uses
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 it's place.
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
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "dataleon"
4
- __version__ = "0.1.0-alpha.7" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.8" # x-release-please-version