Skip to main content
The Python SDK is published on PyPI as printeasy-sdk and imported as printeasy. It offers the same helpers as the TypeScript SDK: retries with backoff, automatic idempotency keys, pagination iterators, webhook verification and create_and_wait.
Responses are plain dictionaries with the same camelCase keys as the API. create_and_wait creates the job and polls until it reaches done, error, cancelled or expired, then returns it. Check job["state"] and job["stateMessage"] rather than expecting an exception for a failed print.

Configuration

The constructor raises ValueError when neither api_key nor PRINTEASY_API_KEY is set. The SDK retries 429 responses (waiting for Retry-After when present), and retries 5xx responses and network errors with exponential backoff, but only for replay-safe requests: GET, PATCH, DELETE, and print job creation (which carries an idempotency key). Other POST requests are not retried on 5xx errors. print_jobs.create and create_and_wait send an Idempotency-Key automatically and reuse it on every retry. Pass idempotency_key="..." to create to use your own key.

Errors

A non-2xx response that survives the retries raises PrintEasyError with status, code and request_id. create_and_wait raises PrintEasyTimeoutError when the job is still not in a final state after timeout_s seconds (default 60); its job attribute holds the last known job.
See Errors for the codes the API returns.

Pagination

list(**params) returns one page as {"data": [...], "hasMore": ..., "nextCursor": ...}. iterate(**params) follows nextCursor for you and yields every item:
computers, printers, print_jobs and webhooks have list, iterate and get. events (and webhook deliveries) have list and iterate only, with no get. Pass after and dir="asc" to events.list to poll for new events.

Webhooks

printeasy.webhooks.verify(body, headers, secret) checks the signature of a request and raises WebhookVerificationError if it is invalid or older than 5 minutes. Pass the raw body, not parsed JSON.
The client also manages endpoints: pe.webhooks.create, update, delete, deliveries(id) and replay(delivery_id). create returns the signing secret once. See Webhooks for a full receiver.

Generated client

The convenience methods sit on top of a client generated from the OpenAPI spec. pe.raw is that client, already configured with your key, base URL and the retrying transport. Use it for an endpoint the wrapper has no helper for.