widgets.sdk-dot10140707 0.2.0__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.
Files changed (33) hide show
  1. widgets_sdk_dot10140707-0.2.0/PKG-INFO +217 -0
  2. widgets_sdk_dot10140707-0.2.0/README.md +186 -0
  3. widgets_sdk_dot10140707-0.2.0/pyproject.toml +94 -0
  4. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/__init__.py +54 -0
  5. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/_default_clients.py +32 -0
  6. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/client.py +282 -0
  7. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/__init__.py +127 -0
  8. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/api_error.py +23 -0
  9. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/client_wrapper.py +133 -0
  10. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/datetime_utils.py +70 -0
  11. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/file.py +67 -0
  12. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/force_multipart.py +18 -0
  13. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_client.py +940 -0
  14. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_response.py +63 -0
  15. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_sse/__init__.py +42 -0
  16. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_sse/_api.py +455 -0
  17. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_sse/_decoders.py +74 -0
  18. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_sse/_exceptions.py +7 -0
  19. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/http_sse/_models.py +17 -0
  20. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/jsonable_encoder.py +133 -0
  21. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/logging.py +107 -0
  22. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/parse_error.py +36 -0
  23. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/pydantic_utilities.py +508 -0
  24. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/query_encoder.py +58 -0
  25. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/remove_none_from_dict.py +11 -0
  26. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/request_options.py +40 -0
  27. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/core/serialization.py +347 -0
  28. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/environment.py +7 -0
  29. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/py.typed +0 -0
  30. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/raw_client.py +104 -0
  31. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/types/__init__.py +34 -0
  32. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/types/widget.py +20 -0
  33. widgets_sdk_dot10140707-0.2.0/src/widgets_sdk_dot10140707/version.py +3 -0
@@ -0,0 +1,217 @@
1
+ Metadata-Version: 2.4
2
+ Name: widgets.sdk_dot10140707
3
+ Version: 0.2.0
4
+ Summary:
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.14.1,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (>=0.1.8,<0.2.0) ; (python_version >= "3.10") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Description-Content-Type: text/markdown
30
+
31
+ # WidgetsDemo1014 Python Library
32
+
33
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=WidgetsDemo1014%2FPython)
34
+ [![pypi](https://img.shields.io/pypi/v/widgets_sdk_dot10140707)](https://pypi.python.org/pypi/widgets_sdk_dot10140707)
35
+
36
+ The WidgetsDemo1014 Python library provides convenient access to the WidgetsDemo1014 APIs from Python.
37
+
38
+ ## Table of Contents
39
+
40
+ - [Installation](#installation)
41
+ - [Reference](#reference)
42
+ - [Usage](#usage)
43
+ - [Environments](#environments)
44
+ - [Async Client](#async-client)
45
+ - [Exception Handling](#exception-handling)
46
+ - [Advanced](#advanced)
47
+ - [Access Raw Response Data](#access-raw-response-data)
48
+ - [Retries](#retries)
49
+ - [Timeouts](#timeouts)
50
+ - [Custom Client](#custom-client)
51
+ - [Contributing](#contributing)
52
+
53
+ ## Installation
54
+
55
+ ```sh
56
+ pip install widgets_sdk_dot10140707
57
+ ```
58
+
59
+ ## Reference
60
+
61
+ A full reference for this library is available [here](./reference.md).
62
+
63
+ ## Usage
64
+
65
+ Instantiate and use the client with the following:
66
+
67
+ ```python
68
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
69
+
70
+ client = WidgetsDemo1014Api()
71
+
72
+ client.get_widget(
73
+ widget_id="widgetId",
74
+ )
75
+ ```
76
+
77
+ ## Environments
78
+
79
+ This SDK allows you to configure different environments for API requests.
80
+
81
+ ```python
82
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
83
+ from widgets_sdk_dot10140707.environment import WidgetsDemo1014ApiEnvironment
84
+
85
+ client = WidgetsDemo1014Api(
86
+ environment=WidgetsDemo1014ApiEnvironment.DEFAULT,
87
+ )
88
+ ```
89
+
90
+ ## Async Client
91
+
92
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
93
+
94
+ ```python
95
+ import asyncio
96
+
97
+ from widgets_sdk_dot10140707 import AsyncWidgetsDemo1014Api
98
+
99
+ client = AsyncWidgetsDemo1014Api()
100
+
101
+
102
+ async def main() -> None:
103
+ await client.get_widget(
104
+ widget_id="widgetId",
105
+ )
106
+
107
+
108
+ asyncio.run(main())
109
+ ```
110
+
111
+ ## Exception Handling
112
+
113
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
114
+ will be thrown.
115
+
116
+ ```python
117
+ from widgets_sdk_dot10140707.core.api_error import ApiError
118
+
119
+ try:
120
+ client.get_widget(...)
121
+ except ApiError as e:
122
+ print(e.status_code)
123
+ print(e.body)
124
+ ```
125
+
126
+ ## Advanced
127
+
128
+ ### Access Raw Response Data
129
+
130
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
131
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
132
+
133
+ ```python
134
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
135
+
136
+ client = WidgetsDemo1014Api(...)
137
+ response = client.with_raw_response.get_widget(...)
138
+ print(response.headers) # access the response headers
139
+ print(response.status_code) # access the response status code
140
+ print(response.data) # access the underlying object
141
+ ```
142
+
143
+ ### Retries
144
+
145
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
146
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
147
+ retry limit (default: 2).
148
+
149
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
150
+
151
+ **`legacy`** (current default): retries on
152
+
153
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
154
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
155
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
156
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
157
+
158
+ **`recommended`**: retries on
159
+
160
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
161
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
162
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
163
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
164
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
165
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
166
+
167
+ Use the `max_retries` request option to configure this behavior.
168
+
169
+ ```python
170
+ client.get_widget(..., request_options={
171
+ "max_retries": 1
172
+ })
173
+ ```
174
+
175
+ ### Timeouts
176
+
177
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
178
+
179
+ ```python
180
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
181
+
182
+ client = WidgetsDemo1014Api(..., timeout=20.0)
183
+
184
+ # Override timeout for a specific method
185
+ client.get_widget(..., request_options={
186
+ "timeout": 1
187
+ })
188
+ ```
189
+
190
+ ### Custom Client
191
+
192
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
193
+ and transports.
194
+
195
+ ```python
196
+ import httpx
197
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
198
+
199
+ client = WidgetsDemo1014Api(
200
+ ...,
201
+ httpx_client=httpx.Client(
202
+ proxy="http://my.test.proxy.example.com",
203
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
204
+ ),
205
+ )
206
+ ```
207
+
208
+ ## Contributing
209
+
210
+ While we value open-source contributions to this SDK, this library is generated programmatically.
211
+ Additions made directly to this library would have to be moved over to our generation code,
212
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
213
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
214
+ an issue first to discuss with us!
215
+
216
+ On the other hand, contributions to the README are always very welcome!
217
+
@@ -0,0 +1,186 @@
1
+ # WidgetsDemo1014 Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=WidgetsDemo1014%2FPython)
4
+ [![pypi](https://img.shields.io/pypi/v/widgets_sdk_dot10140707)](https://pypi.python.org/pypi/widgets_sdk_dot10140707)
5
+
6
+ The WidgetsDemo1014 Python library provides convenient access to the WidgetsDemo1014 APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Environments](#environments)
14
+ - [Async Client](#async-client)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Access Raw Response Data](#access-raw-response-data)
18
+ - [Retries](#retries)
19
+ - [Timeouts](#timeouts)
20
+ - [Custom Client](#custom-client)
21
+ - [Contributing](#contributing)
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ pip install widgets_sdk_dot10140707
27
+ ```
28
+
29
+ ## Reference
30
+
31
+ A full reference for this library is available [here](./reference.md).
32
+
33
+ ## Usage
34
+
35
+ Instantiate and use the client with the following:
36
+
37
+ ```python
38
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
39
+
40
+ client = WidgetsDemo1014Api()
41
+
42
+ client.get_widget(
43
+ widget_id="widgetId",
44
+ )
45
+ ```
46
+
47
+ ## Environments
48
+
49
+ This SDK allows you to configure different environments for API requests.
50
+
51
+ ```python
52
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
53
+ from widgets_sdk_dot10140707.environment import WidgetsDemo1014ApiEnvironment
54
+
55
+ client = WidgetsDemo1014Api(
56
+ environment=WidgetsDemo1014ApiEnvironment.DEFAULT,
57
+ )
58
+ ```
59
+
60
+ ## Async Client
61
+
62
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
63
+
64
+ ```python
65
+ import asyncio
66
+
67
+ from widgets_sdk_dot10140707 import AsyncWidgetsDemo1014Api
68
+
69
+ client = AsyncWidgetsDemo1014Api()
70
+
71
+
72
+ async def main() -> None:
73
+ await client.get_widget(
74
+ widget_id="widgetId",
75
+ )
76
+
77
+
78
+ asyncio.run(main())
79
+ ```
80
+
81
+ ## Exception Handling
82
+
83
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
84
+ will be thrown.
85
+
86
+ ```python
87
+ from widgets_sdk_dot10140707.core.api_error import ApiError
88
+
89
+ try:
90
+ client.get_widget(...)
91
+ except ApiError as e:
92
+ print(e.status_code)
93
+ print(e.body)
94
+ ```
95
+
96
+ ## Advanced
97
+
98
+ ### Access Raw Response Data
99
+
100
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
101
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
102
+
103
+ ```python
104
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
105
+
106
+ client = WidgetsDemo1014Api(...)
107
+ response = client.with_raw_response.get_widget(...)
108
+ print(response.headers) # access the response headers
109
+ print(response.status_code) # access the response status code
110
+ print(response.data) # access the underlying object
111
+ ```
112
+
113
+ ### Retries
114
+
115
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
116
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
117
+ retry limit (default: 2).
118
+
119
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
120
+
121
+ **`legacy`** (current default): retries on
122
+
123
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
124
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
125
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
126
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
127
+
128
+ **`recommended`**: retries on
129
+
130
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
131
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
132
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
133
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
134
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
135
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
136
+
137
+ Use the `max_retries` request option to configure this behavior.
138
+
139
+ ```python
140
+ client.get_widget(..., request_options={
141
+ "max_retries": 1
142
+ })
143
+ ```
144
+
145
+ ### Timeouts
146
+
147
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
148
+
149
+ ```python
150
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
151
+
152
+ client = WidgetsDemo1014Api(..., timeout=20.0)
153
+
154
+ # Override timeout for a specific method
155
+ client.get_widget(..., request_options={
156
+ "timeout": 1
157
+ })
158
+ ```
159
+
160
+ ### Custom Client
161
+
162
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
163
+ and transports.
164
+
165
+ ```python
166
+ import httpx
167
+ from widgets_sdk_dot10140707 import WidgetsDemo1014Api
168
+
169
+ client = WidgetsDemo1014Api(
170
+ ...,
171
+ httpx_client=httpx.Client(
172
+ proxy="http://my.test.proxy.example.com",
173
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
174
+ ),
175
+ )
176
+ ```
177
+
178
+ ## Contributing
179
+
180
+ While we value open-source contributions to this SDK, this library is generated programmatically.
181
+ Additions made directly to this library would have to be moved over to our generation code,
182
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
183
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
184
+ an issue first to discuss with us!
185
+
186
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,94 @@
1
+ [project]
2
+ name = "widgets.sdk_dot10140707"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "widgets.sdk_dot10140707"
7
+ version = "0.2.0"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Operating System :: POSIX",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: Microsoft :: Windows",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed"
30
+ ]
31
+ packages = [
32
+ { include = "widgets_sdk_dot10140707", from = "src"}
33
+ ]
34
+
35
+ [tool.poetry.dependencies]
36
+ python = "^3.10"
37
+ aiohttp = { version = ">=3.14.1,<4", optional = true, python = ">=3.10"}
38
+ httpx = ">=0.21.2"
39
+ httpx-aiohttp = { version = "^0.1.8", optional = true, python = ">=3.10"}
40
+ pydantic = ">= 1.9.2"
41
+ pydantic-core = ">=2.18.2,<3.0.0"
42
+ typing_extensions = ">= 4.0.0"
43
+
44
+ [tool.poetry.group.dev.dependencies]
45
+ mypy = "==1.13.0"
46
+ pytest = "^9.0.3"
47
+ pytest-asyncio = "^1.0.0"
48
+ pytest-xdist = "^3.6.1"
49
+ python-dateutil = "^2.9.0"
50
+ types-python-dateutil = "^2.9.0.20240316"
51
+ urllib3 = ">=2.6.3,<3.0.0"
52
+ ruff = "==0.11.5"
53
+
54
+ [tool.pytest.ini_options]
55
+ testpaths = [ "tests" ]
56
+ asyncio_mode = "auto"
57
+ norecursedirs = [ "src" ]
58
+ markers = [
59
+ "aiohttp: tests that require httpx_aiohttp to be installed",
60
+ ]
61
+
62
+ [tool.mypy]
63
+ plugins = ["pydantic.mypy"]
64
+
65
+ [tool.ruff]
66
+ line-length = 120
67
+
68
+ [tool.ruff.lint]
69
+ select = [
70
+ "E", # pycodestyle errors
71
+ "F", # pyflakes
72
+ "I", # isort
73
+ ]
74
+ ignore = [
75
+ "E402", # Module level import not at top of file
76
+ "E501", # Line too long
77
+ "E711", # Comparison to `None` should be `cond is not None`
78
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
79
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
80
+ "E722", # Do not use bare `except`
81
+ "E731", # Do not assign a `lambda` expression, use a `def`
82
+ "F821", # Undefined name
83
+ "F841" # Local variable ... is assigned to but never used
84
+ ]
85
+
86
+ [tool.ruff.lint.isort]
87
+ section-order = ["future", "standard-library", "third-party", "first-party"]
88
+
89
+ [build-system]
90
+ requires = ["poetry-core"]
91
+ build-backend = "poetry.core.masonry.api"
92
+
93
+ [tool.poetry.extras]
94
+ aiohttp=["aiohttp", "httpx-aiohttp"]
@@ -0,0 +1,54 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import Widget
10
+ from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
11
+ from .client import AsyncWidgetsDemo1014Api, WidgetsDemo1014Api
12
+ from .environment import WidgetsDemo1014ApiEnvironment
13
+ from .version import __version__
14
+ _dynamic_imports: typing.Dict[str, str] = {
15
+ "AsyncWidgetsDemo1014Api": ".client",
16
+ "DefaultAioHttpClient": "._default_clients",
17
+ "DefaultAsyncHttpxClient": "._default_clients",
18
+ "Widget": ".types",
19
+ "WidgetsDemo1014Api": ".client",
20
+ "WidgetsDemo1014ApiEnvironment": ".environment",
21
+ "__version__": ".version",
22
+ }
23
+
24
+
25
+ def __getattr__(attr_name: str) -> typing.Any:
26
+ module_name = _dynamic_imports.get(attr_name)
27
+ if module_name is None:
28
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
29
+ try:
30
+ module = import_module(module_name, __package__)
31
+ if module_name == f".{attr_name}":
32
+ return module
33
+ else:
34
+ return getattr(module, attr_name)
35
+ except ImportError as e:
36
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
37
+ except AttributeError as e:
38
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
39
+
40
+
41
+ def __dir__():
42
+ lazy_attrs = list(_dynamic_imports.keys())
43
+ return sorted(lazy_attrs)
44
+
45
+
46
+ __all__ = [
47
+ "AsyncWidgetsDemo1014Api",
48
+ "DefaultAioHttpClient",
49
+ "DefaultAsyncHttpxClient",
50
+ "Widget",
51
+ "WidgetsDemo1014Api",
52
+ "WidgetsDemo1014ApiEnvironment",
53
+ "__version__",
54
+ ]
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import httpx
6
+
7
+ SDK_DEFAULT_TIMEOUT = 60
8
+
9
+ try:
10
+ import httpx_aiohttp # type: ignore[import-not-found]
11
+ except ImportError:
12
+
13
+ class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
14
+ def __init__(self, **kwargs: typing.Any) -> None:
15
+ raise RuntimeError(
16
+ "To use the aiohttp client, install the aiohttp extra: pip install widgets.sdk_dot10140707[aiohttp]"
17
+ )
18
+
19
+ else:
20
+
21
+ class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
22
+ def __init__(self, **kwargs: typing.Any) -> None:
23
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
24
+ kwargs.setdefault("follow_redirects", True)
25
+ super().__init__(**kwargs)
26
+
27
+
28
+ class DefaultAsyncHttpxClient(httpx.AsyncClient):
29
+ def __init__(self, **kwargs: typing.Any) -> None:
30
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
31
+ kwargs.setdefault("follow_redirects", True)
32
+ super().__init__(**kwargs)