signwell-sdk-python 0.1.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.
- signwell_sdk_python-0.1.0/LICENSE +21 -0
- signwell_sdk_python-0.1.0/PKG-INFO +177 -0
- signwell_sdk_python-0.1.0/README.md +147 -0
- signwell_sdk_python-0.1.0/pyproject.toml +104 -0
- signwell_sdk_python-0.1.0/signwell_sdk/__init__.py +287 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/__init__.py +10 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/api_application_api.py +481 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/bulk_send_api.py +1589 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/document_api.py +2425 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/me_api.py +246 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/regional_api.py +345 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/template_api.py +1298 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api/webhooks_api.py +710 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api_client.py +747 -0
- signwell_sdk_python-0.1.0/signwell_sdk/api_response.py +20 -0
- signwell_sdk_python-0.1.0/signwell_sdk/configuration.py +599 -0
- signwell_sdk_python-0.1.0/signwell_sdk/embedded.py +385 -0
- signwell_sdk_python-0.1.0/signwell_sdk/exceptions.py +314 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/__init__.py +114 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/account_info_response.py +143 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/account_info_response_active_users_inner.py +107 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/account_info_response_preferences.py +147 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/additional_fields_inner_inner.py +274 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/additional_fields_inner_inner_value.py +189 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/additional_files_inner.py +103 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/api_application_response.py +137 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/api_application_response_owner.py +107 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/api_application_response_preferences.py +135 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/attachment_request_info.py +99 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/attachment_requests_inner.py +110 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_create_response.py +132 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_csv_request.py +100 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_csv_template_response.py +97 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_documents_response.py +167 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_list_item.py +141 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_list_response.py +138 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_response.py +151 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_response_templates_inner.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/bulk_send_validate_csv_response.py +129 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/checkbox_group_info.py +138 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/checkbox_groups_inner.py +136 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/checkbox_validation.py +35 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/completed_pdf_response.py +177 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/completed_pdf_url_response.py +97 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/copied_contact_info.py +99 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/copied_contacts_inner.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/copied_placeholders_inner.py +111 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/create_bulk_send_request.py +155 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/create_webhook_request.py +100 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/date_format.py +36 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/detailed_option.py +105 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_from_template_request.py +377 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_from_template_response.py +353 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_from_template_response_fields_inner_inner.py +270 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_from_template_response_fields_inner_inner_recipient.py +99 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_from_template_response_recipients_inner.py +206 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_list_response.py +138 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_request.py +350 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response.py +357 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_attachment_requests_inner.py +101 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_fields_inner_inner.py +268 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_fields_inner_inner_options_inner.py +101 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_fields_inner_inner_recipient.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_fields_inner_inner_value.py +195 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_response_recipients_inner.py +208 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_list_response.py +138 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_request.py +307 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_response.py +323 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_response_copied_placeholders_inner.py +131 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_response_placeholders_inner.py +144 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/document_template_update_request.py +208 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/dropdown_option.py +153 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/error_response.py +107 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/error_response_meta.py +101 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/field_type.py +46 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/fields_inner_inner.py +268 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/file_format.py +33 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/file_info.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/files_inner.py +103 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/label_info.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/label_request.py +97 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/label_response.py +98 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/me_response.py +130 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/me_response_contact.py +147 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/me_response_user.py +117 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/me_response_user_preferences.py +105 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/nom151_certificate_response.py +107 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/nom151_certificate_response_nom151.py +125 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/nom151_url_response.py +97 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/pagination_meta.py +119 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/placeholders_inner.py +115 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/rate_limit_error_response.py +97 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/recipients_inner.py +141 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/reminder_recipients_inner.py +100 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/send_reminder_request.py +114 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_attachment_requests_inner.py +110 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_checkbox_groups_inner.py +136 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_field_values_inner.py +109 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_field_values_inner_value.py +189 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_fields_inner_inner.py +266 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/template_recipients_inner.py +146 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/text_validation.py +42 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/update_document_and_send_request.py +234 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/update_recipients_map_inner.py +118 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/update_recipients_request.py +111 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/validation_error_response.py +99 -0
- signwell_sdk_python-0.1.0/signwell_sdk/models/webhook_response.py +110 -0
- signwell_sdk_python-0.1.0/signwell_sdk/py.typed +0 -0
- signwell_sdk_python-0.1.0/signwell_sdk/rest.py +209 -0
- signwell_sdk_python-0.1.0/signwell_sdk/webhook.py +214 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) SignWell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: signwell-sdk-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the SignWell API
|
|
5
|
+
Keywords: signwell,esignature,api,sdk
|
|
6
|
+
Author: SignWell
|
|
7
|
+
Author-email: SignWell <support@signwell.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Dist: pydantic>=2,<3
|
|
21
|
+
Requires-Dist: python-dateutil>=2.8.2,<3
|
|
22
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
23
|
+
Requires-Dist: urllib3>=1.26.18,<3
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Project-URL: Documentation, https://developers.signwell.com
|
|
26
|
+
Project-URL: Homepage, https://www.signwell.com
|
|
27
|
+
Project-URL: Issues, https://github.com/Bidsketch/signwell-sdk-python/issues
|
|
28
|
+
Project-URL: Repository, https://github.com/Bidsketch/signwell-sdk-python
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# SignWell Python SDK
|
|
32
|
+
|
|
33
|
+
Python SDK for the SignWell API.
|
|
34
|
+
|
|
35
|
+
This package is generated from the SignWell OpenAPI spec by
|
|
36
|
+
`Bidsketch/signwell-sdk-generator`. Do not edit generated SDK runtime files
|
|
37
|
+
directly; make durable changes in the generator repo.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install signwell-sdk-python
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
With uv:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv add signwell-sdk-python
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import os
|
|
55
|
+
|
|
56
|
+
import signwell_sdk
|
|
57
|
+
from signwell_sdk.api.document_api import DocumentApi
|
|
58
|
+
|
|
59
|
+
configuration = signwell_sdk.Configuration(
|
|
60
|
+
api_key={"api_key": os.environ["SIGNWELL_API_KEY"]}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
with signwell_sdk.ApiClient(configuration) as api_client:
|
|
64
|
+
documents = DocumentApi(api_client)
|
|
65
|
+
document = documents.get_document("document-id")
|
|
66
|
+
print(document.id)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The SDK sends the API key in the `X-Api-Key` header. The default host is
|
|
70
|
+
`https://www.signwell.com`.
|
|
71
|
+
|
|
72
|
+
## Resources, Models, And Errors
|
|
73
|
+
|
|
74
|
+
The generated resource clients are available from their generated modules and
|
|
75
|
+
from the parity namespace:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
documents = signwell_sdk.Resources.DocumentApi(api_client)
|
|
79
|
+
model_cls = signwell_sdk.Models.DocumentResponse
|
|
80
|
+
not_found_cls = signwell_sdk.Errors.NotFoundError
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Status-specific errors inherit from `signwell_sdk.ApiException`:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
try:
|
|
87
|
+
documents.get_document("missing")
|
|
88
|
+
except signwell_sdk.Errors.NotFoundError as exc:
|
|
89
|
+
print(exc.status)
|
|
90
|
+
print(exc.data or exc.body)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Binary And JSON Responses
|
|
94
|
+
|
|
95
|
+
Some endpoints can return either JSON or binary data. The SDK selects the
|
|
96
|
+
correct `Accept` header from the mode parameters.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from signwell_sdk.api.bulk_send_api import BulkSendApi
|
|
100
|
+
from signwell_sdk.api.regional_api import RegionalApi
|
|
101
|
+
|
|
102
|
+
bulk_send = BulkSendApi(api_client)
|
|
103
|
+
csv_bytes = bulk_send.get_bulk_send_csv_template(
|
|
104
|
+
["00000000-0000-0000-0000-000000000000"]
|
|
105
|
+
)
|
|
106
|
+
csv_json = bulk_send.get_bulk_send_csv_template(
|
|
107
|
+
["00000000-0000-0000-0000-000000000000"],
|
|
108
|
+
var_base64=True,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
documents = DocumentApi(api_client)
|
|
112
|
+
pdf_bytes = documents.get_completed_pdf("doc_123")
|
|
113
|
+
pdf_url = documents.get_completed_pdf("doc_123", url_only=True)
|
|
114
|
+
|
|
115
|
+
regional = RegionalApi(api_client)
|
|
116
|
+
certificate_bytes = regional.get_nom151_certificate("doc_123")
|
|
117
|
+
certificate_url = regional.get_nom151_certificate("doc_123", url_only=True)
|
|
118
|
+
certificate_object = regional.get_nom151_certificate("doc_123", object_only=True)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Embedded Helpers
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
doc = signwell_sdk.Embedded.create_signing_document(
|
|
125
|
+
name="NDA",
|
|
126
|
+
files=[{"name": "nda.pdf", "file_base64": "JVBERi0xLjQK"}],
|
|
127
|
+
recipients=[{"name": "Jane Doe", "email": "jane@example.com"}],
|
|
128
|
+
fields=[[{"x": 20, "y": 60, "page": 1, "type": "signature"}]],
|
|
129
|
+
options={"api_client": api_client},
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
url = signwell_sdk.Embedded.embedded_signing_url(doc)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Embedded signing documents must include fields for every recipient, set
|
|
136
|
+
`with_signature_page=True`, or set `text_tags=True`.
|
|
137
|
+
|
|
138
|
+
## Webhook Verification
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
payload = request.json()
|
|
142
|
+
event = payload["event"]
|
|
143
|
+
|
|
144
|
+
signwell_sdk.Webhook.verify_event_or_raise(
|
|
145
|
+
event=event,
|
|
146
|
+
webhook_id=os.environ["SIGNWELL_WEBHOOK_ID"],
|
|
147
|
+
tolerance_seconds=300,
|
|
148
|
+
)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
For side-effecting handlers, use replay-aware verification with an atomic store:
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
store = signwell_sdk.Webhook.MemoryReplayStore()
|
|
155
|
+
|
|
156
|
+
signwell_sdk.Webhook.verify_event_once_or_raise(
|
|
157
|
+
event=event,
|
|
158
|
+
webhook_id=os.environ["SIGNWELL_WEBHOOK_ID"],
|
|
159
|
+
tolerance_seconds=300,
|
|
160
|
+
replay_store=store,
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`MemoryReplayStore` is intended for local development and single-process apps.
|
|
165
|
+
Production apps should use a shared atomic store such as Redis or a database
|
|
166
|
+
table with a uniqueness constraint.
|
|
167
|
+
|
|
168
|
+
## Local Package Build
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
uv sync --dev
|
|
172
|
+
uv run pytest
|
|
173
|
+
uv build --no-sources
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`uv build --no-sources` verifies that the source distribution and wheel can be
|
|
177
|
+
built from publishable package metadata.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# SignWell Python SDK
|
|
2
|
+
|
|
3
|
+
Python SDK for the SignWell API.
|
|
4
|
+
|
|
5
|
+
This package is generated from the SignWell OpenAPI spec by
|
|
6
|
+
`Bidsketch/signwell-sdk-generator`. Do not edit generated SDK runtime files
|
|
7
|
+
directly; make durable changes in the generator repo.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install signwell-sdk-python
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
With uv:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv add signwell-sdk-python
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import os
|
|
25
|
+
|
|
26
|
+
import signwell_sdk
|
|
27
|
+
from signwell_sdk.api.document_api import DocumentApi
|
|
28
|
+
|
|
29
|
+
configuration = signwell_sdk.Configuration(
|
|
30
|
+
api_key={"api_key": os.environ["SIGNWELL_API_KEY"]}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
with signwell_sdk.ApiClient(configuration) as api_client:
|
|
34
|
+
documents = DocumentApi(api_client)
|
|
35
|
+
document = documents.get_document("document-id")
|
|
36
|
+
print(document.id)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The SDK sends the API key in the `X-Api-Key` header. The default host is
|
|
40
|
+
`https://www.signwell.com`.
|
|
41
|
+
|
|
42
|
+
## Resources, Models, And Errors
|
|
43
|
+
|
|
44
|
+
The generated resource clients are available from their generated modules and
|
|
45
|
+
from the parity namespace:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
documents = signwell_sdk.Resources.DocumentApi(api_client)
|
|
49
|
+
model_cls = signwell_sdk.Models.DocumentResponse
|
|
50
|
+
not_found_cls = signwell_sdk.Errors.NotFoundError
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Status-specific errors inherit from `signwell_sdk.ApiException`:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
try:
|
|
57
|
+
documents.get_document("missing")
|
|
58
|
+
except signwell_sdk.Errors.NotFoundError as exc:
|
|
59
|
+
print(exc.status)
|
|
60
|
+
print(exc.data or exc.body)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Binary And JSON Responses
|
|
64
|
+
|
|
65
|
+
Some endpoints can return either JSON or binary data. The SDK selects the
|
|
66
|
+
correct `Accept` header from the mode parameters.
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from signwell_sdk.api.bulk_send_api import BulkSendApi
|
|
70
|
+
from signwell_sdk.api.regional_api import RegionalApi
|
|
71
|
+
|
|
72
|
+
bulk_send = BulkSendApi(api_client)
|
|
73
|
+
csv_bytes = bulk_send.get_bulk_send_csv_template(
|
|
74
|
+
["00000000-0000-0000-0000-000000000000"]
|
|
75
|
+
)
|
|
76
|
+
csv_json = bulk_send.get_bulk_send_csv_template(
|
|
77
|
+
["00000000-0000-0000-0000-000000000000"],
|
|
78
|
+
var_base64=True,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
documents = DocumentApi(api_client)
|
|
82
|
+
pdf_bytes = documents.get_completed_pdf("doc_123")
|
|
83
|
+
pdf_url = documents.get_completed_pdf("doc_123", url_only=True)
|
|
84
|
+
|
|
85
|
+
regional = RegionalApi(api_client)
|
|
86
|
+
certificate_bytes = regional.get_nom151_certificate("doc_123")
|
|
87
|
+
certificate_url = regional.get_nom151_certificate("doc_123", url_only=True)
|
|
88
|
+
certificate_object = regional.get_nom151_certificate("doc_123", object_only=True)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Embedded Helpers
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
doc = signwell_sdk.Embedded.create_signing_document(
|
|
95
|
+
name="NDA",
|
|
96
|
+
files=[{"name": "nda.pdf", "file_base64": "JVBERi0xLjQK"}],
|
|
97
|
+
recipients=[{"name": "Jane Doe", "email": "jane@example.com"}],
|
|
98
|
+
fields=[[{"x": 20, "y": 60, "page": 1, "type": "signature"}]],
|
|
99
|
+
options={"api_client": api_client},
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
url = signwell_sdk.Embedded.embedded_signing_url(doc)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Embedded signing documents must include fields for every recipient, set
|
|
106
|
+
`with_signature_page=True`, or set `text_tags=True`.
|
|
107
|
+
|
|
108
|
+
## Webhook Verification
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
payload = request.json()
|
|
112
|
+
event = payload["event"]
|
|
113
|
+
|
|
114
|
+
signwell_sdk.Webhook.verify_event_or_raise(
|
|
115
|
+
event=event,
|
|
116
|
+
webhook_id=os.environ["SIGNWELL_WEBHOOK_ID"],
|
|
117
|
+
tolerance_seconds=300,
|
|
118
|
+
)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
For side-effecting handlers, use replay-aware verification with an atomic store:
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
store = signwell_sdk.Webhook.MemoryReplayStore()
|
|
125
|
+
|
|
126
|
+
signwell_sdk.Webhook.verify_event_once_or_raise(
|
|
127
|
+
event=event,
|
|
128
|
+
webhook_id=os.environ["SIGNWELL_WEBHOOK_ID"],
|
|
129
|
+
tolerance_seconds=300,
|
|
130
|
+
replay_store=store,
|
|
131
|
+
)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`MemoryReplayStore` is intended for local development and single-process apps.
|
|
135
|
+
Production apps should use a shared atomic store such as Redis or a database
|
|
136
|
+
table with a uniqueness constraint.
|
|
137
|
+
|
|
138
|
+
## Local Package Build
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
uv sync --dev
|
|
142
|
+
uv run pytest
|
|
143
|
+
uv build --no-sources
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`uv build --no-sources` verifies that the source distribution and wheel can be
|
|
147
|
+
built from publishable package metadata.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "signwell-sdk-python"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python SDK for the SignWell API"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "SignWell", email = "support@signwell.com" }
|
|
11
|
+
]
|
|
12
|
+
keywords = ["signwell", "esignature", "api", "sdk"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Typing :: Typed"
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"pydantic>=2,<3",
|
|
27
|
+
"python-dateutil>=2.8.2,<3",
|
|
28
|
+
"typing-extensions>=4.7.1",
|
|
29
|
+
"urllib3>=1.26.18,<3"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://www.signwell.com"
|
|
34
|
+
Repository = "https://github.com/Bidsketch/signwell-sdk-python"
|
|
35
|
+
Issues = "https://github.com/Bidsketch/signwell-sdk-python/issues"
|
|
36
|
+
Documentation = "https://developers.signwell.com"
|
|
37
|
+
|
|
38
|
+
[dependency-groups]
|
|
39
|
+
dev = [
|
|
40
|
+
"mypy>=1.8",
|
|
41
|
+
"pytest>=8",
|
|
42
|
+
"ruff>=0.8",
|
|
43
|
+
"twine>=5",
|
|
44
|
+
"types-python-dateutil>=2.8.19.14"
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["uv_build>=0.8.4,<0.9.0"]
|
|
49
|
+
build-backend = "uv_build"
|
|
50
|
+
|
|
51
|
+
[tool.uv.build-backend]
|
|
52
|
+
module-name = "signwell_sdk"
|
|
53
|
+
module-root = ""
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
line-length = 120
|
|
57
|
+
target-version = "py310"
|
|
58
|
+
extend-exclude = [
|
|
59
|
+
".openapi-generator",
|
|
60
|
+
"docs",
|
|
61
|
+
"test"
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[tool.ruff.lint]
|
|
65
|
+
select = ["B", "C4", "E", "F", "I", "SIM", "UP"]
|
|
66
|
+
ignore = [
|
|
67
|
+
"B008",
|
|
68
|
+
"B904",
|
|
69
|
+
"C409",
|
|
70
|
+
"C405",
|
|
71
|
+
"E721",
|
|
72
|
+
"E501",
|
|
73
|
+
"F401",
|
|
74
|
+
"F811",
|
|
75
|
+
"I001",
|
|
76
|
+
"SIM101",
|
|
77
|
+
"SIM105",
|
|
78
|
+
"SIM118",
|
|
79
|
+
"SIM108",
|
|
80
|
+
"UP030",
|
|
81
|
+
"UP031",
|
|
82
|
+
"UP006",
|
|
83
|
+
"UP007",
|
|
84
|
+
"UP035"
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
[tool.pytest.ini_options]
|
|
88
|
+
testpaths = ["tests"]
|
|
89
|
+
addopts = "-q"
|
|
90
|
+
|
|
91
|
+
[tool.mypy]
|
|
92
|
+
python_version = "3.10"
|
|
93
|
+
files = ["signwell_sdk", "tests"]
|
|
94
|
+
exclude = ["^test/"]
|
|
95
|
+
ignore_missing_imports = true
|
|
96
|
+
follow_imports = "silent"
|
|
97
|
+
warn_unused_configs = true
|
|
98
|
+
warn_redundant_casts = true
|
|
99
|
+
warn_unused_ignores = true
|
|
100
|
+
check_untyped_defs = true
|
|
101
|
+
disallow_untyped_defs = false
|
|
102
|
+
disallow_any_generics = false
|
|
103
|
+
no_implicit_optional = true
|
|
104
|
+
strict_equality = true
|