Printable SDK for Python
Official Python client for the Printable document-generation service integration API: templates, print-forms, batch rendering, document drafts and webhook verification — with HMAC request signing (simple and strict canonical modes) built in and byte-compatible with the server implementation.
Zero runtime dependencies (stdlib only). Python 3.10+. Server-side only — the secret key must never reach untrusted environments.
Install
pip install printable-api-sdk
Quick start
from printable_sdk import PrintableClient
client = PrintableClient(
base_url="https://printable.example.com",
token="erp-main-7f3a",
secret_key=os.environ["PRINTABLE_SECRET"],
salt=os.environ["PRINTABLE_SALT"],
strict=False, # True if the credential has "verify full payload hash" enabled
)
# Render a document
doc = client.print_form_create({
"template": "invoice",
"variables": {"company": {"name": "ACME Ltd"}},
"format": "link",
})
print(doc["link"])
# Batch with archive + email delivery
batch = client.print_form_batch({
"template": "certificate",
"items": [{"variables": {"name": "Alice"}}, {"variables": {"name": "Bob"}}],
"archive": True,
"deliver": {"email": "hr@example.com"},
})
status = client.print_form_batch_get(batch["uuid"])
API surface
template_list · template_contract · template_export ·
template_import · template_import_docx · print_form_create ·
print_form_get · print_form_rules · print_form_batch ·
print_form_batch_get · document_draft_create · document_draft_get ·
call(method, endpoint, params) (escape hatch).
Every method returns the decoded payload dict of the response envelope.
Errors (non-2xx or success: false) raise PrintableError with
.status, .error_key and the raw error .payload.
Webhooks
valid = client.verify_webhook(
raw_body, # raw request body string
request.headers["X-Printable-Signature"],
request.headers["X-Printable-Timestamp"],
)
Testing your integration
Inject a custom transport to stub HTTP:
client = PrintableClient(
...,
transport=lambda method, url, body: (200, '{"success":true,"payload":{"ok":true}}'),
)
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file printable_api_sdk-1.0.0.tar.gz.
File metadata
- Download URL: printable_api_sdk-1.0.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1332f2f8bb05965276eb120a38755f6cf6ede00726624fe82a4846e9428bdf7
|
|
| MD5 |
4b8327520cf6c039f26f17d0ac7b3468
|
|
| BLAKE2b-256 |
fe96418bf66563da1f4f9f26f234f9d957f6fd9aa80e9e04283c5631be510810
|
Provenance
The following attestation bundles were made for printable_api_sdk-1.0.0.tar.gz:
Publisher:
publish.yml on dskripchenko/printable-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
printable_api_sdk-1.0.0.tar.gz -
Subject digest:
e1332f2f8bb05965276eb120a38755f6cf6ede00726624fe82a4846e9428bdf7 - Sigstore transparency entry: 2269579592
- Sigstore integration time:
-
Permalink:
dskripchenko/printable-sdk-python@d80884c323e8f37341357b4438ec8e8d3429cd58 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/dskripchenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d80884c323e8f37341357b4438ec8e8d3429cd58 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file printable_api_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: printable_api_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d426c40d0e22766a18feac95c9496dc55b6f1a64ea44c93530cecafb1e9f4f9d
|
|
| MD5 |
fa467637349e335906665d1900b0c4a1
|
|
| BLAKE2b-256 |
3e2adbcdc9a2f4a5f110488fbe18cb602c07ecc8e844f658af92d870ee6ac280
|
Provenance
The following attestation bundles were made for printable_api_sdk-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on dskripchenko/printable-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
printable_api_sdk-1.0.0-py3-none-any.whl -
Subject digest:
d426c40d0e22766a18feac95c9496dc55b6f1a64ea44c93530cecafb1e9f4f9d - Sigstore transparency entry: 2269580043
- Sigstore integration time:
-
Permalink:
dskripchenko/printable-sdk-python@d80884c323e8f37341357b4438ec8e8d3429cd58 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/dskripchenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d80884c323e8f37341357b4438ec8e8d3429cd58 -
Trigger Event:
workflow_dispatch
-
Statement type: