pulse-python-sdk 0.0.52__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 (72) hide show
  1. pulse_python_sdk-0.0.52/PKG-INFO +197 -0
  2. pulse_python_sdk-0.0.52/README.md +169 -0
  3. pulse_python_sdk-0.0.52/pyproject.toml +86 -0
  4. pulse_python_sdk-0.0.52/src/pulse/__init__.py +42 -0
  5. pulse_python_sdk-0.0.52/src/pulse/client.py +666 -0
  6. pulse_python_sdk-0.0.52/src/pulse/core/__init__.py +34 -0
  7. pulse_python_sdk-0.0.52/src/pulse/core/api_error.py +23 -0
  8. pulse_python_sdk-0.0.52/src/pulse/core/client_wrapper.py +89 -0
  9. pulse_python_sdk-0.0.52/src/pulse/core/datetime_utils.py +28 -0
  10. pulse_python_sdk-0.0.52/src/pulse/core/file.py +67 -0
  11. pulse_python_sdk-0.0.52/src/pulse/core/force_multipart.py +18 -0
  12. pulse_python_sdk-0.0.52/src/pulse/core/http_client.py +663 -0
  13. pulse_python_sdk-0.0.52/src/pulse/core/http_response.py +55 -0
  14. pulse_python_sdk-0.0.52/src/pulse/core/http_sse/__init__.py +42 -0
  15. pulse_python_sdk-0.0.52/src/pulse/core/http_sse/_api.py +112 -0
  16. pulse_python_sdk-0.0.52/src/pulse/core/http_sse/_decoders.py +61 -0
  17. pulse_python_sdk-0.0.52/src/pulse/core/http_sse/_exceptions.py +7 -0
  18. pulse_python_sdk-0.0.52/src/pulse/core/http_sse/_models.py +17 -0
  19. pulse_python_sdk-0.0.52/src/pulse/core/jsonable_encoder.py +100 -0
  20. pulse_python_sdk-0.0.52/src/pulse/core/pydantic_utilities.py +260 -0
  21. pulse_python_sdk-0.0.52/src/pulse/core/query_encoder.py +58 -0
  22. pulse_python_sdk-0.0.52/src/pulse/core/remove_none_from_dict.py +11 -0
  23. pulse_python_sdk-0.0.52/src/pulse/core/request_options.py +35 -0
  24. pulse_python_sdk-0.0.52/src/pulse/core/serialization.py +276 -0
  25. pulse_python_sdk-0.0.52/src/pulse/core/unchecked_base_model.py +396 -0
  26. pulse_python_sdk-0.0.52/src/pulse/environment.py +7 -0
  27. pulse_python_sdk-0.0.52/src/pulse/errors/__init__.py +4 -0
  28. pulse_python_sdk-0.0.52/src/pulse/errors/bad_request_error.py +10 -0
  29. pulse_python_sdk-0.0.52/src/pulse/errors/forbidden_error.py +10 -0
  30. pulse_python_sdk-0.0.52/src/pulse/errors/internal_server_error.py +10 -0
  31. pulse_python_sdk-0.0.52/src/pulse/errors/not_found_error.py +10 -0
  32. pulse_python_sdk-0.0.52/src/pulse/errors/too_many_requests_error.py +10 -0
  33. pulse_python_sdk-0.0.52/src/pulse/errors/unauthorized_error.py +10 -0
  34. pulse_python_sdk-0.0.52/src/pulse/jobs/__init__.py +4 -0
  35. pulse_python_sdk-0.0.52/src/pulse/jobs/client.py +191 -0
  36. pulse_python_sdk-0.0.52/src/pulse/jobs/raw_client.py +408 -0
  37. pulse_python_sdk-0.0.52/src/pulse/py.typed +0 -0
  38. pulse_python_sdk-0.0.52/src/pulse/raw_client.py +661 -0
  39. pulse_python_sdk-0.0.52/src/pulse/types/__init__.py +4 -0
  40. pulse_python_sdk-0.0.52/src/pulse/types/extract_async_input.py +5 -0
  41. pulse_python_sdk-0.0.52/src/pulse/types/extract_async_response.py +43 -0
  42. pulse_python_sdk-0.0.52/src/pulse/types/extract_async_submission_response_status.py +7 -0
  43. pulse_python_sdk-0.0.52/src/pulse/types/extract_input.py +5 -0
  44. pulse_python_sdk-0.0.52/src/pulse/types/extract_json_input.py +116 -0
  45. pulse_python_sdk-0.0.52/src/pulse/types/extract_json_input_experimental_schema.py +5 -0
  46. pulse_python_sdk-0.0.52/src/pulse/types/extract_json_input_schema.py +5 -0
  47. pulse_python_sdk-0.0.52/src/pulse/types/extract_json_input_storage.py +36 -0
  48. pulse_python_sdk-0.0.52/src/pulse/types/extract_json_input_structured_output.py +38 -0
  49. pulse_python_sdk-0.0.52/src/pulse/types/extract_multipart_input.py +111 -0
  50. pulse_python_sdk-0.0.52/src/pulse/types/extract_multipart_input_experimental_schema.py +5 -0
  51. pulse_python_sdk-0.0.52/src/pulse/types/extract_multipart_input_schema.py +5 -0
  52. pulse_python_sdk-0.0.52/src/pulse/types/extract_multipart_input_storage.py +36 -0
  53. pulse_python_sdk-0.0.52/src/pulse/types/extract_multipart_input_structured_output.py +38 -0
  54. pulse_python_sdk-0.0.52/src/pulse/types/extract_options.py +111 -0
  55. pulse_python_sdk-0.0.52/src/pulse/types/extract_options_experimental_schema.py +5 -0
  56. pulse_python_sdk-0.0.52/src/pulse/types/extract_options_schema.py +5 -0
  57. pulse_python_sdk-0.0.52/src/pulse/types/extract_options_storage.py +36 -0
  58. pulse_python_sdk-0.0.52/src/pulse/types/extract_options_structured_output.py +38 -0
  59. pulse_python_sdk-0.0.52/src/pulse/types/extract_response.py +47 -0
  60. pulse_python_sdk-0.0.52/src/pulse/types/extract_source_multipart_one.py +27 -0
  61. pulse_python_sdk-0.0.52/src/pulse/types/extract_source_multipart_zero.py +27 -0
  62. pulse_python_sdk-0.0.52/src/pulse/types/job_cancellation_response.py +32 -0
  63. pulse_python_sdk-0.0.52/src/pulse/types/job_status.py +5 -0
  64. pulse_python_sdk-0.0.52/src/pulse/types/job_status_response.py +50 -0
  65. pulse_python_sdk-0.0.52/src/pulse/types/json_source.py +29 -0
  66. pulse_python_sdk-0.0.52/src/pulse/types/multipart_source.py +8 -0
  67. pulse_python_sdk-0.0.52/src/pulse/version.py +3 -0
  68. pulse_python_sdk-0.0.52/src/pulse/webhooks/__init__.py +4 -0
  69. pulse_python_sdk-0.0.52/src/pulse/webhooks/client.py +104 -0
  70. pulse_python_sdk-0.0.52/src/pulse/webhooks/raw_client.py +139 -0
  71. pulse_python_sdk-0.0.52/src/pulse/webhooks/types/__init__.py +4 -0
  72. pulse_python_sdk-0.0.52/src/pulse/webhooks/types/create_webhook_link_response.py +23 -0
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.1
2
+ Name: pulse-python-sdk
3
+ Version: 0.0.52
4
+ Summary:
5
+ Requires-Python: >=3.8,<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.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: httpx (>=0.21.2)
22
+ Requires-Dist: pydantic (>=1.9.2)
23
+ Requires-Dist: pydantic-core (>=2.18.2)
24
+ Requires-Dist: typing_extensions (>=4.0.0)
25
+ Project-URL: Repository, https://github.com/Pulse-Software-Corp/pulse-python-sdk
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Pulse Python Library
29
+
30
+ [![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=https%3A%2F%2Fgithub.com%2FPulse-Software-Corp%2Fpulse-python-sdk)
31
+ [![pypi](https://img.shields.io/pypi/v/pulse-python-sdk)](https://pypi.python.org/pypi/pulse-python-sdk)
32
+
33
+ The Pulse Python library provides convenient access to the Pulse APIs from Python.
34
+
35
+ ## Table of Contents
36
+
37
+ - [Installation](#installation)
38
+ - [Reference](#reference)
39
+ - [Usage](#usage)
40
+ - [Async Client](#async-client)
41
+ - [Exception Handling](#exception-handling)
42
+ - [Advanced](#advanced)
43
+ - [Access Raw Response Data](#access-raw-response-data)
44
+ - [Retries](#retries)
45
+ - [Timeouts](#timeouts)
46
+ - [Custom Client](#custom-client)
47
+ - [Contributing](#contributing)
48
+
49
+ ## Installation
50
+
51
+ ```sh
52
+ pip install pulse-python-sdk
53
+ ```
54
+
55
+ ## Reference
56
+
57
+ A full reference for this library is available [here](https://github.com/Pulse-Software-Corp/pulse-python-sdk/blob/HEAD/./reference.md).
58
+
59
+ ## Usage
60
+
61
+ Instantiate and use the client with the following:
62
+
63
+ ```python
64
+ from pulse import Pulse
65
+
66
+ client = Pulse(
67
+ api_key="YOUR_API_KEY",
68
+ )
69
+ client.extract(
70
+ file_url="fileUrl",
71
+ )
72
+ ```
73
+
74
+ ## Async Client
75
+
76
+ 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).
77
+
78
+ ```python
79
+ import asyncio
80
+
81
+ from pulse import AsyncPulse
82
+
83
+ client = AsyncPulse(
84
+ api_key="YOUR_API_KEY",
85
+ )
86
+
87
+
88
+ async def main() -> None:
89
+ await client.extract(
90
+ file_url="fileUrl",
91
+ )
92
+
93
+
94
+ asyncio.run(main())
95
+ ```
96
+
97
+ ## Exception Handling
98
+
99
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
100
+ will be thrown.
101
+
102
+ ```python
103
+ from pulse.core.api_error import ApiError
104
+
105
+ try:
106
+ client.extract(...)
107
+ except ApiError as e:
108
+ print(e.status_code)
109
+ print(e.body)
110
+ ```
111
+
112
+ ## Advanced
113
+
114
+ ### Access Raw Response Data
115
+
116
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
117
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
118
+
119
+ ```python
120
+ from pulse import Pulse
121
+
122
+ client = Pulse(
123
+ ...,
124
+ )
125
+ response = client.with_raw_response.extract(...)
126
+ print(response.headers) # access the response headers
127
+ print(response.data) # access the underlying object
128
+ ```
129
+
130
+ ### Retries
131
+
132
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
133
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
134
+ retry limit (default: 2).
135
+
136
+ A request is deemed retryable when any of the following HTTP status codes is returned:
137
+
138
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
139
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
140
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
141
+
142
+ Use the `max_retries` request option to configure this behavior.
143
+
144
+ ```python
145
+ client.extract(..., request_options={
146
+ "max_retries": 1
147
+ })
148
+ ```
149
+
150
+ ### Timeouts
151
+
152
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
153
+
154
+ ```python
155
+
156
+ from pulse import Pulse
157
+
158
+ client = Pulse(
159
+ ...,
160
+ timeout=20.0,
161
+ )
162
+
163
+
164
+ # Override timeout for a specific method
165
+ client.extract(..., request_options={
166
+ "timeout_in_seconds": 1
167
+ })
168
+ ```
169
+
170
+ ### Custom Client
171
+
172
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
173
+ and transports.
174
+
175
+ ```python
176
+ import httpx
177
+ from pulse import Pulse
178
+
179
+ client = Pulse(
180
+ ...,
181
+ httpx_client=httpx.Client(
182
+ proxy="http://my.test.proxy.example.com",
183
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
184
+ ),
185
+ )
186
+ ```
187
+
188
+ ## Contributing
189
+
190
+ While we value open-source contributions to this SDK, this library is generated programmatically.
191
+ Additions made directly to this library would have to be moved over to our generation code,
192
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
193
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
194
+ an issue first to discuss with us!
195
+
196
+ On the other hand, contributions to the README are always very welcome!
197
+
@@ -0,0 +1,169 @@
1
+ # Pulse 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=https%3A%2F%2Fgithub.com%2FPulse-Software-Corp%2Fpulse-python-sdk)
4
+ [![pypi](https://img.shields.io/pypi/v/pulse-python-sdk)](https://pypi.python.org/pypi/pulse-python-sdk)
5
+
6
+ The Pulse Python library provides convenient access to the Pulse APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Async Client](#async-client)
14
+ - [Exception Handling](#exception-handling)
15
+ - [Advanced](#advanced)
16
+ - [Access Raw Response Data](#access-raw-response-data)
17
+ - [Retries](#retries)
18
+ - [Timeouts](#timeouts)
19
+ - [Custom Client](#custom-client)
20
+ - [Contributing](#contributing)
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ pip install pulse-python-sdk
26
+ ```
27
+
28
+ ## Reference
29
+
30
+ A full reference for this library is available [here](https://github.com/Pulse-Software-Corp/pulse-python-sdk/blob/HEAD/./reference.md).
31
+
32
+ ## Usage
33
+
34
+ Instantiate and use the client with the following:
35
+
36
+ ```python
37
+ from pulse import Pulse
38
+
39
+ client = Pulse(
40
+ api_key="YOUR_API_KEY",
41
+ )
42
+ client.extract(
43
+ file_url="fileUrl",
44
+ )
45
+ ```
46
+
47
+ ## Async Client
48
+
49
+ 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).
50
+
51
+ ```python
52
+ import asyncio
53
+
54
+ from pulse import AsyncPulse
55
+
56
+ client = AsyncPulse(
57
+ api_key="YOUR_API_KEY",
58
+ )
59
+
60
+
61
+ async def main() -> None:
62
+ await client.extract(
63
+ file_url="fileUrl",
64
+ )
65
+
66
+
67
+ asyncio.run(main())
68
+ ```
69
+
70
+ ## Exception Handling
71
+
72
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
73
+ will be thrown.
74
+
75
+ ```python
76
+ from pulse.core.api_error import ApiError
77
+
78
+ try:
79
+ client.extract(...)
80
+ except ApiError as e:
81
+ print(e.status_code)
82
+ print(e.body)
83
+ ```
84
+
85
+ ## Advanced
86
+
87
+ ### Access Raw Response Data
88
+
89
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
90
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
91
+
92
+ ```python
93
+ from pulse import Pulse
94
+
95
+ client = Pulse(
96
+ ...,
97
+ )
98
+ response = client.with_raw_response.extract(...)
99
+ print(response.headers) # access the response headers
100
+ print(response.data) # access the underlying object
101
+ ```
102
+
103
+ ### Retries
104
+
105
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
106
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
107
+ retry limit (default: 2).
108
+
109
+ A request is deemed retryable when any of the following HTTP status codes is returned:
110
+
111
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
112
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
113
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
114
+
115
+ Use the `max_retries` request option to configure this behavior.
116
+
117
+ ```python
118
+ client.extract(..., request_options={
119
+ "max_retries": 1
120
+ })
121
+ ```
122
+
123
+ ### Timeouts
124
+
125
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
126
+
127
+ ```python
128
+
129
+ from pulse import Pulse
130
+
131
+ client = Pulse(
132
+ ...,
133
+ timeout=20.0,
134
+ )
135
+
136
+
137
+ # Override timeout for a specific method
138
+ client.extract(..., request_options={
139
+ "timeout_in_seconds": 1
140
+ })
141
+ ```
142
+
143
+ ### Custom Client
144
+
145
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
146
+ and transports.
147
+
148
+ ```python
149
+ import httpx
150
+ from pulse import Pulse
151
+
152
+ client = Pulse(
153
+ ...,
154
+ httpx_client=httpx.Client(
155
+ proxy="http://my.test.proxy.example.com",
156
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
157
+ ),
158
+ )
159
+ ```
160
+
161
+ ## Contributing
162
+
163
+ While we value open-source contributions to this SDK, this library is generated programmatically.
164
+ Additions made directly to this library would have to be moved over to our generation code,
165
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
166
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
167
+ an issue first to discuss with us!
168
+
169
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,86 @@
1
+ [project]
2
+ name = "pulse-python-sdk"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "pulse-python-sdk"
7
+ version = "0.0.52"
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.8",
18
+ "Programming Language :: Python :: 3.9",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Operating System :: OS Independent",
23
+ "Operating System :: POSIX",
24
+ "Operating System :: MacOS",
25
+ "Operating System :: POSIX :: Linux",
26
+ "Operating System :: Microsoft :: Windows",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ "Typing :: Typed"
29
+ ]
30
+ packages = [
31
+ { include = "pulse", from = "src"}
32
+ ]
33
+
34
+ [tool.poetry.urls]
35
+ Repository = 'https://github.com/Pulse-Software-Corp/pulse-python-sdk'
36
+
37
+ [tool.poetry.dependencies]
38
+ python = "^3.8"
39
+ httpx = ">=0.21.2"
40
+ pydantic = ">= 1.9.2"
41
+ pydantic-core = ">=2.18.2"
42
+ typing_extensions = ">= 4.0.0"
43
+
44
+ [tool.poetry.group.dev.dependencies]
45
+ mypy = "==1.13.0"
46
+ pytest = "^7.4.0"
47
+ pytest-asyncio = "^0.23.5"
48
+ pytest-xdist = "^3.6.1"
49
+ python-dateutil = "^2.9.0"
50
+ types-python-dateutil = "^2.9.0.20240316"
51
+ ruff = "==0.11.5"
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = [ "tests" ]
55
+ asyncio_mode = "auto"
56
+
57
+ [tool.mypy]
58
+ plugins = ["pydantic.mypy"]
59
+
60
+ [tool.ruff]
61
+ line-length = 120
62
+
63
+ [tool.ruff.lint]
64
+ select = [
65
+ "E", # pycodestyle errors
66
+ "F", # pyflakes
67
+ "I", # isort
68
+ ]
69
+ ignore = [
70
+ "E402", # Module level import not at top of file
71
+ "E501", # Line too long
72
+ "E711", # Comparison to `None` should be `cond is not None`
73
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
74
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
75
+ "E722", # Do not use bare `except`
76
+ "E731", # Do not assign a `lambda` expression, use a `def`
77
+ "F821", # Undefined name
78
+ "F841" # Local variable ... is assigned to but never used
79
+ ]
80
+
81
+ [tool.ruff.lint.isort]
82
+ section-order = ["future", "standard-library", "third-party", "first-party"]
83
+
84
+ [build-system]
85
+ requires = ["poetry-core"]
86
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,42 @@
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 . import jobs, webhooks
10
+ from .client import AsyncPulse, Pulse
11
+ from .version import __version__
12
+ _dynamic_imports: typing.Dict[str, str] = {
13
+ "AsyncPulse": ".client",
14
+ "Pulse": ".client",
15
+ "__version__": ".version",
16
+ "jobs": ".jobs",
17
+ "webhooks": ".webhooks",
18
+ }
19
+
20
+
21
+ def __getattr__(attr_name: str) -> typing.Any:
22
+ module_name = _dynamic_imports.get(attr_name)
23
+ if module_name is None:
24
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
25
+ try:
26
+ module = import_module(module_name, __package__)
27
+ if module_name == f".{attr_name}":
28
+ return module
29
+ else:
30
+ return getattr(module, attr_name)
31
+ except ImportError as e:
32
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
33
+ except AttributeError as e:
34
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
35
+
36
+
37
+ def __dir__():
38
+ lazy_attrs = list(_dynamic_imports.keys())
39
+ return sorted(lazy_attrs)
40
+
41
+
42
+ __all__ = ["AsyncPulse", "Pulse", "__version__", "jobs", "webhooks"]