Skip to main content

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

printable_api_sdk-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

printable_api_sdk-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for printable_api_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e1332f2f8bb05965276eb120a38755f6cf6ede00726624fe82a4846e9428bdf7
MD5 4b8327520cf6c039f26f17d0ac7b3468
BLAKE2b-256 fe96418bf66563da1f4f9f26f234f9d957f6fd9aa80e9e04283c5631be510810

See more details on using hashes here.

Provenance

The following attestation bundles were made for printable_api_sdk-1.0.0.tar.gz:

Publisher: publish.yml on dskripchenko/printable-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file printable_api_sdk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for printable_api_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d426c40d0e22766a18feac95c9496dc55b6f1a64ea44c93530cecafb1e9f4f9d
MD5 fa467637349e335906665d1900b0c4a1
BLAKE2b-256 3e2adbcdc9a2f4a5f110488fbe18cb602c07ecc8e844f658af92d870ee6ac280

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page