https://github.com/docspring/docspring-python
Python API Client for DocSpring
https://github.com/docspring/docspring-python
Last synced: 5 days ago
JSON representation
Python API Client for DocSpring
- Host: GitHub
- URL: https://github.com/docspring/docspring-python
- Owner: DocSpring
- License: mit
- Created: 2019-11-08T18:11:03.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-09-24T00:58:59.000Z (9 months ago)
- Last Synced: 2026-04-29T06:07:46.782Z (about 2 months ago)
- Language: Python
- Homepage: https://pypi.org/project/docspring/
- Size: 406 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# docspring
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: v1
- Package version: 3.0.0
- Generator version: 7.16.0-DOCSPRING
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
Python 3.9+
## Installation & Usage
### pip install
If the python package is hosted on a repository, you can install directly using:
```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
Then import the package:
```python
import docspring
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import docspring
```
### Tests
Execute `pytest` to run the tests.
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
import docspring
from docspring.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
host = "https://sync.api.docspring.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspring.Client(api_client)
template_id = 'tpl_1234567890abcdef02' # str |
data = docspring.AddFieldsData() # AddFieldsData |
try:
# Add new fields to a Template
api_response = api_instance.add_fields_to_template(template_id, data)
print("The response of Client->add_fields_to_template:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling Client->add_fields_to_template: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *https://sync.api.docspring.com/api/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Client* | [**add_fields_to_template**](docs/Client.md#add_fields_to_template) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template
*Client* | [**batch_generate_pdfs**](docs/Client.md#batch_generate_pdfs) | **POST** /submissions/batches | Generate multiple PDFs
*Client* | [**combine_pdfs**](docs/Client.md#combine_pdfs) | **POST** /combined_submissions | Merge submission PDFs, template PDFs, or custom files
*Client* | [**copy_template**](docs/Client.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a template
*Client* | [**create_custom_file_from_upload**](docs/Client.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached S3 upload
*Client* | [**create_data_request_event**](docs/Client.md#create_data_request_event) | **POST** /data_requests/{data_request_id}/events | Create a new event for emailing a signee a request for signature
*Client* | [**create_data_request_token**](docs/Client.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Create a new data request token for form authentication
*Client* | [**create_folder**](docs/Client.md#create_folder) | **POST** /folders/ | Create a folder
*Client* | [**create_html_template**](docs/Client.md#create_html_template) | **POST** /templates?endpoint_variant=create_html_template | Create a new HTML template
*Client* | [**create_pdf_template**](docs/Client.md#create_pdf_template) | **POST** /templates | Create a new PDF template with a form POST file upload
*Client* | [**create_pdf_template_from_upload**](docs/Client.md#create_pdf_template_from_upload) | **POST** /templates?endpoint_variant=create_template_from_cached_upload | Create a new PDF template from a cached S3 file upload
*Client* | [**delete_folder**](docs/Client.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder
*Client* | [**delete_template**](docs/Client.md#delete_template) | **DELETE** /templates/{template_id} | Delete a template
*Client* | [**expire_combined_submission**](docs/Client.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission
*Client* | [**expire_submission**](docs/Client.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission
*Client* | [**generate_pdf**](docs/Client.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generate a PDF
*Client* | [**generate_preview**](docs/Client.md#generate_preview) | **POST** /submissions/{submission_id}/generate_preview | Generate a preview PDF for partially completed data requests
*Client* | [**get_combined_submission**](docs/Client.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs)
*Client* | [**get_data_request**](docs/Client.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request
*Client* | [**get_full_template**](docs/Client.md#get_full_template) | **GET** /templates/{template_id}?full=true | Fetch the full attributes for a PDF template
*Client* | [**get_presign_url**](docs/Client.md#get_presign_url) | **GET** /uploads/presign | Get a presigned S3 URL for direct file upload
*Client* | [**get_submission**](docs/Client.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF
*Client* | [**get_submission_batch**](docs/Client.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
*Client* | [**get_template**](docs/Client.md#get_template) | **GET** /templates/{template_id} | Check the status of an uploaded template
*Client* | [**get_template_schema**](docs/Client.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template
*Client* | [**list_combined_submissions**](docs/Client.md#list_combined_submissions) | **GET** /combined_submissions | Get a list of all combined submissions
*Client* | [**list_folders**](docs/Client.md#list_folders) | **GET** /folders/ | Get a list of all folders
*Client* | [**list_submissions**](docs/Client.md#list_submissions) | **GET** /submissions | List all submissions
*Client* | [**list_template_submissions**](docs/Client.md#list_template_submissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template
*Client* | [**list_templates**](docs/Client.md#list_templates) | **GET** /templates | Get a list of all templates
*Client* | [**move_folder_to_folder**](docs/Client.md#move_folder_to_folder) | **POST** /folders/{folder_id}/move | Move a folder
*Client* | [**move_template_to_folder**](docs/Client.md#move_template_to_folder) | **POST** /templates/{template_id}/move | Move Template to folder
*Client* | [**publish_template_version**](docs/Client.md#publish_template_version) | **POST** /templates/{template_id}/publish_version | Publish a template version
*Client* | [**rename_folder**](docs/Client.md#rename_folder) | **POST** /folders/{folder_id}/rename | Rename a folder
*Client* | [**restore_template_version**](docs/Client.md#restore_template_version) | **POST** /templates/{template_id}/restore_version | Restore a template version
*Client* | [**test_authentication**](docs/Client.md#test_authentication) | **GET** /authentication | Test authentication
*Client* | [**update_data_request**](docs/Client.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request
*Client* | [**update_template**](docs/Client.md#update_template) | **PUT** /templates/{template_id} | Update a Template
*Client* | [**update_template_document**](docs/Client.md#update_template_document) | **PUT** /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post | Update a template's document with a form POST file upload
*Client* | [**update_template_document_from_upload**](docs/Client.md#update_template_document_from_upload) | **PUT** /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload | Update a template's document with a cached S3 file upload
## Documentation For Models
- [AddFieldsData](docs/AddFieldsData.md)
- [BatchGeneratePdfs201Response](docs/BatchGeneratePdfs201Response.md)
- [CombinePdfsData](docs/CombinePdfsData.md)
- [CombinedSubmission](docs/CombinedSubmission.md)
- [CombinedSubmissionAction](docs/CombinedSubmissionAction.md)
- [CopyTemplateOptions](docs/CopyTemplateOptions.md)
- [CreateCombinedSubmissionResponse](docs/CreateCombinedSubmissionResponse.md)
- [CreateCustomFileData](docs/CreateCustomFileData.md)
- [CreateCustomFileResponse](docs/CreateCustomFileResponse.md)
- [CreateFolderData](docs/CreateFolderData.md)
- [CreateHtmlTemplate](docs/CreateHtmlTemplate.md)
- [CreatePdfSubmissionData](docs/CreatePdfSubmissionData.md)
- [CreatePdfTemplate](docs/CreatePdfTemplate.md)
- [CreateSubmissionDataRequestData](docs/CreateSubmissionDataRequestData.md)
- [CreateSubmissionDataRequestEventRequest](docs/CreateSubmissionDataRequestEventRequest.md)
- [CreateSubmissionDataRequestEventResponse](docs/CreateSubmissionDataRequestEventResponse.md)
- [CreateSubmissionDataRequestResponse](docs/CreateSubmissionDataRequestResponse.md)
- [CreateSubmissionDataRequestTokenResponse](docs/CreateSubmissionDataRequestTokenResponse.md)
- [CreateSubmissionResponse](docs/CreateSubmissionResponse.md)
- [CustomFile](docs/CustomFile.md)
- [ErrorOrMultipleErrorsResponse](docs/ErrorOrMultipleErrorsResponse.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [Folder](docs/Folder.md)
- [JsonSchema](docs/JsonSchema.md)
- [ListSubmissionsResponse](docs/ListSubmissionsResponse.md)
- [MoveFolderData](docs/MoveFolderData.md)
- [MoveTemplateData](docs/MoveTemplateData.md)
- [MultipleErrorsResponse](docs/MultipleErrorsResponse.md)
- [PublishVersionData](docs/PublishVersionData.md)
- [RenameFolderData](docs/RenameFolderData.md)
- [RestoreVersionData](docs/RestoreVersionData.md)
- [Submission](docs/Submission.md)
- [Submission422Response](docs/Submission422Response.md)
- [SubmissionAction](docs/SubmissionAction.md)
- [SubmissionBatch](docs/SubmissionBatch.md)
- [SubmissionBatchData](docs/SubmissionBatchData.md)
- [SubmissionBatchWithSubmissions](docs/SubmissionBatchWithSubmissions.md)
- [SubmissionDataRequest](docs/SubmissionDataRequest.md)
- [SubmissionDataRequestEvent](docs/SubmissionDataRequestEvent.md)
- [SubmissionDataRequestShow](docs/SubmissionDataRequestShow.md)
- [SubmissionDataRequestToken](docs/SubmissionDataRequestToken.md)
- [SubmissionPreview](docs/SubmissionPreview.md)
- [SuccessErrorResponse](docs/SuccessErrorResponse.md)
- [SuccessMultipleErrorsResponse](docs/SuccessMultipleErrorsResponse.md)
- [Template](docs/Template.md)
- [TemplateAddFieldsResponse](docs/TemplateAddFieldsResponse.md)
- [TemplateDeleteResponse](docs/TemplateDeleteResponse.md)
- [TemplatePreview](docs/TemplatePreview.md)
- [TemplatePublishVersionResponse](docs/TemplatePublishVersionResponse.md)
- [UpdateHtmlTemplate](docs/UpdateHtmlTemplate.md)
- [UpdatePdfTemplate](docs/UpdatePdfTemplate.md)
- [UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md)
- [UploadPresignResponse](docs/UploadPresignResponse.md)
## Documentation For Authorization
Authentication schemes defined for the API:
### api_token_basic
- **Type**: HTTP basic authentication
## Author