Skip to content

Commit d020efb

Browse files
committed
Updated on 2026-10-18 16:56:57. Version: 3.2.0
1 parent f8d24c8 commit d020efb

63 files changed

Lines changed: 691 additions & 958 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# AGENTS.md
2+
3+
Notes for AI coding agents working with the DocSpring Python SDK (`docspring`), in this repository or
4+
as a dependency of an app.
5+
6+
## This code is generated
7+
8+
Every file here is generated from DocSpring's OpenAPI spec by
9+
[DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches), and each release replaces
10+
all of it. Don't edit it or open pull requests that change it, and don't patch an installed copy: the next release
11+
overwrites the change. Report bugs at https://github.com/DocSpring/docspring-python/issues or to support@docspring.com, and DocSpring fixes them in
12+
the generator.
13+
14+
## Where to look
15+
16+
- [README.md](README.md): install, configuration, an example and how errors and API changes are handled.
17+
- [docs/Client.md](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md): every method, with its parameters and return type.
18+
- [docs/](https://github.com/DocSpring/docspring-python/tree/main/docs): every model and its fields.
19+
- https://docspring.com/docs/llms.txt: DocSpring's documentation for LLMs (`llms-small.txt`, `llms-full.txt`).
20+
- https://docspring.com/docs/api/: the API reference, with Python code for every method.
21+
- https://docspring.com/api-docs/v1/openapi.json: the OpenAPI spec this SDK is generated from.
22+
23+
## Using it in an app
24+
25+
- Credentials come from `DOCSPRING_TOKEN_ID` and `DOCSPRING_TOKEN_SECRET`. Keep them in the environment or a secret
26+
store, never in code. Accounts in the EU region also need `DOCSPRING_REGION=EU`.
27+
- Template IDs look like `tpl_...` and submission IDs like `sub_...`.
28+
- Pass `test: true` when you generate PDFs during development: test PDFs are free and watermarked.
29+
- Generating a PDF waits for it, for up to 95 seconds. For many PDFs or slow templates, set `wait` to false and use
30+
webhooks or check the submission later (https://docspring.com/docs/api-guide/synchronous-requests/).
31+
- Errors: Methods raise `docspring.ApiException` for an error response (or a subclass from `docspring.exceptions`, such as `NotFoundException`), with the HTTP status in `status` and the body in `body`.
32+
- Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v1 without a new
33+
version. The model keeps a response field added to the API after this release in its `additional_properties` dict. An enum value added to the API after this release comes back as a string, so handle values you don't recognize.

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### 3.2.0 [October 18, 2026]
2+
3+
- Response models keep fields this version doesn't know in `additional_properties`.
4+
- Templates: new `parse_dates_using_template_date_format` setting, when you create or update a template. When it's
5+
true, date values sent as NN/NN/YYYY (with slashes, dashes or dots) are read in the order of the template's default
6+
date format: month first for `%m/%d/%Y`, day first for `%d/%m/%Y`. When it's false, they're read day first.
7+
- A new README: installing, a quick start, every API method, errors, and how API changes are handled. The repository
8+
also has an AGENTS.md for coding agents.
9+
110
### 3.1.0 [October 15, 2026]
211

312
- Submissions and data requests can now be in the `declined` state, when a signer declines to sign. Data

‎README.md‎

Lines changed: 139 additions & 200 deletions
Large diffs are not rendered by default.

‎docs/Template.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Name | Type | Description | Notes
3434
**page_count** | **int** | |
3535
**page_dimensions** | **List[List[float]]** | |
3636
**parent_folder_id** | **str** | |
37+
**parse_dates_using_template_date_format** | **bool** | |
3738
**path** | **str** | |
3839
**permanent_document_url** | **str** | |
3940
**public_submissions** | **bool** | |

‎docs/TemplatePreview.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Name | Type | Description | Notes
3434
**page_count** | **int** | |
3535
**page_dimensions** | **List[List[float]]** | |
3636
**parent_folder_id** | **str** | |
37+
**parse_dates_using_template_date_format** | **bool** | |
3738
**path** | **str** | |
3839
**permanent_document_url** | **str** | |
3940
**public_submissions** | **bool** | |

‎docspring/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "3.1.0"
18+
__version__ = "3.2.0"
1919

2020
# Define package exports
2121
__all__ = [

‎docspring/api_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
self.default_headers[header_name] = header_value
9393
self.cookie = cookie
9494
# Set default User-Agent.
95-
self.user_agent = 'docspring-python-3.1.0'
95+
self.user_agent = 'docspring-python-3.2.0'
9696
self.client_side_validation = configuration.client_side_validation
9797

9898
def __enter__(self):

‎docspring/configuration.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def to_debug_report(self) -> str:
527527
"OS: {env}\n"\
528528
"Python Version: {pyversion}\n"\
529529
"Version of the API: v1\n"\
530-
"SDK Package Version: 3.1.0".\
530+
"SDK Package Version: 3.2.0".\
531531
format(env=sys.platform, pyversion=sys.version)
532532

533533
def get_host_settings(self) -> List[HostSetting]:

‎docspring/models/batch_generate_pdfs201_response.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class BatchGeneratePdfs201Response(BaseModel):
3333
errors: Optional[List[StrictStr]] = None
3434
submission_batch: SubmissionBatch
3535
submissions: List[Dict[str, Any]]
36+
additional_properties: Dict[str, Any] = {}
3637
__properties: ClassVar[List[str]] = ["status", "error", "errors", "submission_batch", "submissions"]
3738

3839
@field_validator('status')
@@ -76,8 +77,10 @@ def to_dict(self) -> Dict[str, Any]:
7677
* `None` is only added to the output dict for nullable fields that
7778
were set at model initialization. Other fields with value `None`
7879
are ignored.
80+
* Fields in `self.additional_properties` are added to the output dict.
7981
"""
8082
excluded_fields: Set[str] = set([
83+
"additional_properties",
8184
])
8285

8386
_dict = self.model_dump(
@@ -88,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]:
8891
# override the default output from pydantic by calling `to_dict()` of submission_batch
8992
if self.submission_batch:
9093
_dict['submission_batch'] = self.submission_batch.to_dict()
94+
# puts key-value pairs in additional_properties in the top level
95+
if self.additional_properties is not None:
96+
for _key, _value in self.additional_properties.items():
97+
_dict[_key] = _value
98+
9199
return _dict
92100

93101
@classmethod
@@ -106,6 +114,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
106114
"submission_batch": SubmissionBatch.from_dict(obj["submission_batch"]) if obj.get("submission_batch") is not None else None,
107115
"submissions": obj.get("submissions")
108116
}, context={"skip_enum_validation": True})
117+
# store additional fields in additional_properties
118+
for _key in obj.keys():
119+
if _key not in cls.__properties:
120+
_obj.additional_properties[_key] = obj.get(_key)
121+
109122
return _obj
110123

111124

‎docspring/models/combined_submission.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class CombinedSubmission(BaseModel):
4242
pdf_hash: Optional[StrictStr]
4343
download_url: Optional[StrictStr]
4444
actions: List[CombinedSubmissionAction]
45+
additional_properties: Dict[str, Any] = {}
4546
__properties: ClassVar[List[str]] = ["id", "state", "expired", "expires_in", "expires_at", "processed_at", "error_message", "submission_ids", "source_pdfs", "metadata", "password", "pdf_hash", "download_url", "actions"]
4647

4748
@field_validator('state')
@@ -85,8 +86,10 @@ def to_dict(self) -> Dict[str, Any]:
8586
* `None` is only added to the output dict for nullable fields that
8687
were set at model initialization. Other fields with value `None`
8788
are ignored.
89+
* Fields in `self.additional_properties` are added to the output dict.
8890
"""
8991
excluded_fields: Set[str] = set([
92+
"additional_properties",
9093
])
9194

9295
_dict = self.model_dump(
@@ -101,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]:
101104
if _item_actions:
102105
_items.append(_item_actions.to_dict())
103106
_dict['actions'] = _items
107+
# puts key-value pairs in additional_properties in the top level
108+
if self.additional_properties is not None:
109+
for _key, _value in self.additional_properties.items():
110+
_dict[_key] = _value
111+
104112
# set to None if id (nullable) is None
105113
# and model_fields_set contains the field
106114
if self.id is None and "id" in self.model_fields_set:
@@ -168,6 +176,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
168176
"download_url": obj.get("download_url"),
169177
"actions": [CombinedSubmissionAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None
170178
}, context={"skip_enum_validation": True})
179+
# store additional fields in additional_properties
180+
for _key in obj.keys():
181+
if _key not in cls.__properties:
182+
_obj.additional_properties[_key] = obj.get(_key)
183+
171184
return _obj
172185

173186

0 commit comments

Comments
 (0)