pulse-python-sdk 0.0.52__py3-none-any.whl

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/__init__.py +42 -0
  2. pulse/client.py +666 -0
  3. pulse/core/__init__.py +34 -0
  4. pulse/core/api_error.py +23 -0
  5. pulse/core/client_wrapper.py +89 -0
  6. pulse/core/datetime_utils.py +28 -0
  7. pulse/core/file.py +67 -0
  8. pulse/core/force_multipart.py +18 -0
  9. pulse/core/http_client.py +663 -0
  10. pulse/core/http_response.py +55 -0
  11. pulse/core/http_sse/__init__.py +42 -0
  12. pulse/core/http_sse/_api.py +112 -0
  13. pulse/core/http_sse/_decoders.py +61 -0
  14. pulse/core/http_sse/_exceptions.py +7 -0
  15. pulse/core/http_sse/_models.py +17 -0
  16. pulse/core/jsonable_encoder.py +100 -0
  17. pulse/core/pydantic_utilities.py +260 -0
  18. pulse/core/query_encoder.py +58 -0
  19. pulse/core/remove_none_from_dict.py +11 -0
  20. pulse/core/request_options.py +35 -0
  21. pulse/core/serialization.py +276 -0
  22. pulse/core/unchecked_base_model.py +396 -0
  23. pulse/environment.py +7 -0
  24. pulse/errors/__init__.py +4 -0
  25. pulse/errors/bad_request_error.py +10 -0
  26. pulse/errors/forbidden_error.py +10 -0
  27. pulse/errors/internal_server_error.py +10 -0
  28. pulse/errors/not_found_error.py +10 -0
  29. pulse/errors/too_many_requests_error.py +10 -0
  30. pulse/errors/unauthorized_error.py +10 -0
  31. pulse/jobs/__init__.py +4 -0
  32. pulse/jobs/client.py +191 -0
  33. pulse/jobs/raw_client.py +408 -0
  34. pulse/py.typed +0 -0
  35. pulse/raw_client.py +661 -0
  36. pulse/types/__init__.py +4 -0
  37. pulse/types/extract_async_input.py +5 -0
  38. pulse/types/extract_async_response.py +43 -0
  39. pulse/types/extract_async_submission_response_status.py +7 -0
  40. pulse/types/extract_input.py +5 -0
  41. pulse/types/extract_json_input.py +116 -0
  42. pulse/types/extract_json_input_experimental_schema.py +5 -0
  43. pulse/types/extract_json_input_schema.py +5 -0
  44. pulse/types/extract_json_input_storage.py +36 -0
  45. pulse/types/extract_json_input_structured_output.py +38 -0
  46. pulse/types/extract_multipart_input.py +111 -0
  47. pulse/types/extract_multipart_input_experimental_schema.py +5 -0
  48. pulse/types/extract_multipart_input_schema.py +5 -0
  49. pulse/types/extract_multipart_input_storage.py +36 -0
  50. pulse/types/extract_multipart_input_structured_output.py +38 -0
  51. pulse/types/extract_options.py +111 -0
  52. pulse/types/extract_options_experimental_schema.py +5 -0
  53. pulse/types/extract_options_schema.py +5 -0
  54. pulse/types/extract_options_storage.py +36 -0
  55. pulse/types/extract_options_structured_output.py +38 -0
  56. pulse/types/extract_response.py +47 -0
  57. pulse/types/extract_source_multipart_one.py +27 -0
  58. pulse/types/extract_source_multipart_zero.py +27 -0
  59. pulse/types/job_cancellation_response.py +32 -0
  60. pulse/types/job_status.py +5 -0
  61. pulse/types/job_status_response.py +50 -0
  62. pulse/types/json_source.py +29 -0
  63. pulse/types/multipart_source.py +8 -0
  64. pulse/version.py +3 -0
  65. pulse/webhooks/__init__.py +4 -0
  66. pulse/webhooks/client.py +104 -0
  67. pulse/webhooks/raw_client.py +139 -0
  68. pulse/webhooks/types/__init__.py +4 -0
  69. pulse/webhooks/types/create_webhook_link_response.py +23 -0
  70. pulse_python_sdk-0.0.52.dist-info/METADATA +197 -0
  71. pulse_python_sdk-0.0.52.dist-info/RECORD +72 -0
  72. pulse_python_sdk-0.0.52.dist-info/WHEEL +4 -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,72 @@
1
+ pulse/__init__.py,sha256=K1NGq3DqJIxpclZTQ5TtPKiCZVrwhR5DSZFQJVzGzXk,1285
2
+ pulse/client.py,sha256=L13lZ4anycqMZsLJed7I058tWCW5ISErg5Rk7Iak4-U,26247
3
+ pulse/core/__init__.py,sha256=oGy-hrWZlt5m1nGu3eG0-1kTEH2YuCWqqDxlLXFwv7E,1100
4
+ pulse/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
5
+ pulse/core/client_wrapper.py,sha256=dqp4O6rnfUihcJbrJMSUXZ-87HtsN5PY8RNPezS8agg,2838
6
+ pulse/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
7
+ pulse/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
8
+ pulse/core/force_multipart.py,sha256=cH981xLy0kZVKiZZkFoeUjgJ2Zuq7KXB2aRAnmHzRDc,477
9
+ pulse/core/http_client.py,sha256=cXuS6t54TJ-rSGIGvZlYEz4d_CY8ulJy1thx1hAHoX4,25726
10
+ pulse/core/http_response.py,sha256=A6URkoTBCiryctAA-m9EiDWOsHgM5oYAlcYVc_YOiiI,1330
11
+ pulse/core/http_sse/__init__.py,sha256=vE7RxBmzIfV9SmFDw4YCuDN9DaPuJb3FAnoFDo7bqww,1350
12
+ pulse/core/http_sse/_api.py,sha256=v7bcIkdawmL6Y39HxrM5OiEB1Ci3wzIdu21kCZII-mU,3920
13
+ pulse/core/http_sse/_decoders.py,sha256=tY3L5TZ0y-pgz0Lu1q8ro5Ljz43q4lYyuec73u9WfNw,1733
14
+ pulse/core/http_sse/_exceptions.py,sha256=o8Tp-e8Lvmtn_5MVSYbkW9rVrpwFg5pnKbOcHfrHH14,127
15
+ pulse/core/http_sse/_models.py,sha256=kKvCCm8e6gCilulJpiHv4f2OPVxo9CydLboEqMhplPI,397
16
+ pulse/core/jsonable_encoder.py,sha256=hGgcEEeX11sqxxsll7h15pO3pTNVxk_n79Kcn0laoWA,3655
17
+ pulse/core/pydantic_utilities.py,sha256=fxp1jeDn1YbKXbVabl0hI9YeC3LtN8ZQ4HIICyFS8xg,10966
18
+ pulse/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
19
+ pulse/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
20
+ pulse/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
21
+ pulse/core/serialization.py,sha256=ECL3bvv_0i7U4uvPidZCNel--MUbA0iq0aGcNKi3kws,9818
22
+ pulse/core/unchecked_base_model.py,sha256=24eoPRbtEx2TAarwTmC6JiR0tM6QkmUbrVu7J0mWkE4,15006
23
+ pulse/environment.py,sha256=32vp_3e7BnDsHMWNRrF-sV7dsDULFbC7Q5anenafkjA,152
24
+ pulse/errors/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
25
+ pulse/errors/bad_request_error.py,sha256=rmt2UyKLfCwaztIVmSogAAcv1dlEBZHjo06QurKWmiw,321
26
+ pulse/errors/forbidden_error.py,sha256=7489eBXhYtjpap2ifhSc99N9o7v6evag0svQu_EQ4tM,320
27
+ pulse/errors/internal_server_error.py,sha256=SQy3jeXTg5IpLev9opjUIDvq_33rwqQLXmiW2UJjW4k,325
28
+ pulse/errors/not_found_error.py,sha256=7GQ0iCCRpVeg55InQsDsMMD3HomNjc4d-dHYWkUnZLw,319
29
+ pulse/errors/too_many_requests_error.py,sha256=Qq5JyxITVwruL0_9kGS5TjlRVvudI_AdWXwz7Ku78xo,326
30
+ pulse/errors/unauthorized_error.py,sha256=cDi1t15echZjvUjgAAUi-LwZozyBxKT4kw30tWL0x8U,323
31
+ pulse/jobs/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
32
+ pulse/jobs/client.py,sha256=2YRqPW-HHv3UdtJyqqaHX4bkZU3j1GlLgxkDNhihUwU,5357
33
+ pulse/jobs/raw_client.py,sha256=hyQRBhI671nt3m882CRxqv-MROdWu_XQfFzT1_OiqNs,16238
34
+ pulse/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ pulse/raw_client.py,sha256=_8y8GV-vM0s0pdHPzMSsyHy7U5smrz1sBiikUMnOp7Q,30086
36
+ pulse/types/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
37
+ pulse/types/extract_async_input.py,sha256=WNG-G5JH8mF1DIXii29hOM3JOTk_FaKbwaGQn9m6ub4,111
38
+ pulse/types/extract_async_response.py,sha256=DEmJ67COVxgkv1Q79Vns63ZVXAQYn-FI6lWmqptvHg8,1284
39
+ pulse/types/extract_async_submission_response_status.py,sha256=u6geQ7SC3mEyvqYoJiUWAWLN-F3wwULq71kohSJueQ0,226
40
+ pulse/types/extract_input.py,sha256=ch0NIdSIsQEmaWpDYxT2wYcecvcHoBikAS02wzI2NuI,106
41
+ pulse/types/extract_json_input.py,sha256=ngFNLoh15DWWltAT5RLpOn5j0BNhBdl7CfABNPljdSg,4419
42
+ pulse/types/extract_json_input_experimental_schema.py,sha256=OvSYPpo126Q8ayxBEzRI5UOaausJgexbBmT-A6UZ7v8,165
43
+ pulse/types/extract_json_input_schema.py,sha256=gFReVhKIjJDm5Vn_sJDVYllKXZ4W947fiCMDm4RMBNQ,153
44
+ pulse/types/extract_json_input_storage.py,sha256=0EdLx6opmbA-6ciJwgu9V_mwWuZAzDzEg1LrNyy87UM,1238
45
+ pulse/types/extract_json_input_structured_output.py,sha256=bNFCwcIpajH5jZYy5xPG7xn4MCj333Dnaaat3-iRxMA,1244
46
+ pulse/types/extract_multipart_input.py,sha256=50zUw0CKWULknFEbs28FZIsOgZqaqb8RQC7KU3VA6rA,4325
47
+ pulse/types/extract_multipart_input_experimental_schema.py,sha256=oF3oZAtIyFURHBEfd8tlytFgSB3KIOyn3Qh3njPnYNA,170
48
+ pulse/types/extract_multipart_input_schema.py,sha256=S8hZB-hkSdLwTKSJ-zkT4alep6yaXd1ZstpK8eGV79U,158
49
+ pulse/types/extract_multipart_input_storage.py,sha256=CamBp_5eJySK7QE2xWK6zaT2FB301lgqII6mGSI5D5I,1243
50
+ pulse/types/extract_multipart_input_structured_output.py,sha256=vUM-dpv05kquW_6XB8EnVtHkS3mqQgezDCcOHoA0p2g,1249
51
+ pulse/types/extract_options.py,sha256=8q3J4BfeJsYZUvCMqIO-iZSqj3EJIB2Cw-_5JOrQSgA,4236
52
+ pulse/types/extract_options_experimental_schema.py,sha256=BVOmwA0CzKSpMtWA7c36Juq2Q5Ej4FI_7XKWHVSyAh0,163
53
+ pulse/types/extract_options_schema.py,sha256=sgddwR8MABnAj5eqg8i8VtbGCuKoIDFOpZGxD1w97cQ,151
54
+ pulse/types/extract_options_storage.py,sha256=y07EpcTWZES_jXI4J6z5vvRTuEjRKeuK4Klc9cQDFP8,1236
55
+ pulse/types/extract_options_structured_output.py,sha256=8KpuTGtmaYC8X4y-Uo5cPSruHQwKodNaBN28Kr5hPbs,1242
56
+ pulse/types/extract_response.py,sha256=d7-LsDYp90583qHRL81wpC6leE6lTnR9XPxEzG8ncmI,1339
57
+ pulse/types/extract_source_multipart_one.py,sha256=cTpkmRTKfokTvNAWk3qiDqPmm07eXtxQXaGThreCYS8,856
58
+ pulse/types/extract_source_multipart_zero.py,sha256=bfAkUbstsY0Lr9TnadVE0FknJjvEd6LRFtJ8RiodX-E,823
59
+ pulse/types/job_cancellation_response.py,sha256=-oGk4tlHPWXOuuK07dSGimCfu7imKLCk6TCzLMGm4Wg,833
60
+ pulse/types/job_status.py,sha256=C8iXHDrugWWMnJ8o-6SvQTT3aOZD4FuAe3QAgPMGXco,193
61
+ pulse/types/job_status_response.py,sha256=sFdqbuPgK0-SaKGHDNbRahi43aGlDnE3UZTCmKQJaXc,1408
62
+ pulse/types/json_source.py,sha256=Dv8GXpfAid3URfigzOp7M0tVGHxWPG4C4hDioDb-kag,862
63
+ pulse/types/multipart_source.py,sha256=3nbotmmkUeUjDINjgTPkGe1NfojCj-k4ywlktAwGWTg,305
64
+ pulse/version.py,sha256=Fm3QIBgQla9gCQzBmukxfHxgNGpwhEwmvAH-WfCJ5T0,83
65
+ pulse/webhooks/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
66
+ pulse/webhooks/client.py,sha256=HRiH2iNoz5-N8b5PUpvZ8YbCYBrCEZhPkEJu4nnvdsU,3035
67
+ pulse/webhooks/raw_client.py,sha256=TddIuwLCT4EdnS34iFSmaZ3TTwytlYsYRMZoKFLNGDQ,5573
68
+ pulse/webhooks/types/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
69
+ pulse/webhooks/types/create_webhook_link_response.py,sha256=9U-dtBqzQ4uh3I6PGb8FcyxOeLRDkMLBr56OT0FcZHk,643
70
+ pulse_python_sdk-0.0.52.dist-info/METADATA,sha256=XVdfj_Ua7iLvQoQJMDli2S1OLSonJ0lAvKR0E5-mATk,5622
71
+ pulse_python_sdk-0.0.52.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
72
+ pulse_python_sdk-0.0.52.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.6.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any