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 · template_import_xlsx ·
print_form_create ·
print_form_get · print_form_rules · print_form_signature_request ·
print_form_signature_complete · print_form_signature_invite ·
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.
Signing and protection
print-form/create and print-form/batch accept optional parameters, passed as-is in the params:
preset— a print-preset code used instead oftemplate(document-draft/createaccepts it too);signing— a signature profile per slot, a visible or invisible signature, the reason, andrecipients— the counterparties who sign the document themselves;protection— PDF protection:{"generate": true}lets the service generate the password, or pass your own one underpassword; the optionalpermissionsisread_print,read_onlyorforms_sign.
The response then carries a protection block (protected, permissions, password, owner_password). Passwords are returned only once — in the response that issues the document; afterwards they come back masked (••••••••), so store them right away. Each signature.slots[] item may carry method (cms, plugin, pdf or sig) and signature_link — the recipient's detached .sig.
doc = client.print_form_create({
"preset": "contract-signed",
"variables": {"contract": {"number": 15}},
"signing": {
"slots": {"company": {"profile": "ceo"}},
"invisible": False,
"reason": "Contract 15",
"recipients": {"buyer": {"email": "buyer@example.com", "name": "Buyer LLC"}},
},
"protection": {"generate": True, "permissions": "read_print"},
})
# The password comes only in this response — store it now
protection = doc["protection"]
# Hand the link over yourself, or let the service email it
invite = client.print_form_signature_invite(doc["uuid"], "buyer@example.com", "buyer", "Buyer LLC")
print(invite["sign_url"])
print_form_signature_invite() invites the recipient to sign: it returns sign_url — a personal link to the signing page (CryptoPro browser plug-in, a detached .sig upload, or a PDF signed in its field) — and expires_at. With an email address the service also sends the link (sent).
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
Metadata
Release files for printable-api-sdk 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| printable_api_sdk-1.1.0.tar.gz | 25.5 kB | With provenance | Details for printable_api_sdk-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| printable_api_sdk-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for printable_api_sdk-1.1.0-py3-none-any.whl |
Total release size: 34.8 kB
Release files / printable_api_sdk-1.1.0.tar.gz
| Download URL | printable_api_sdk-1.1.0.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed04af4ae8d7e8836f505e2223a228dff0afae140aa50b2b344cb683bc833b86
|
|
BLAKE2b-256 checksum How to use checksums |
8199dc107523a452af174b2c17a337ebef2fe044483f338dac4379bd144dc656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / printable_api_sdk-1.1.0-py3-none-any.whl
| Download URL | printable_api_sdk-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6815772f9e2794dc2190d7c743f004daa8a4938a93409338a673806c14e3b4f
|
|
BLAKE2b-256 checksum How to use checksums |
1d66862eecda2a5459ba73a01083200d43b78317761d4f7d4d6aa0700110aa88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for printable-api-sdk 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for printable_api_sdk-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.