Skip to main content

uvpdftool

The UV pdfTool API from Python 3.9 and later: compress, convert, OCR and check PDFs on UV pdfTool's servers. The standard library only; type hints included.

pip install uvpdftool
import os

from uvpdftool import Client, JobFailedError

client = Client(api_key=os.environ["UVPDF_KEY"])

# Creates the job, uploads the file, starts it and waits for it.
job = client.run(
    "compress",
    files=["report.pdf"],
    options={"method": "ghostscript", "preset": "ebook"},
)

for output in job.outputs:
    client.download(output, output.name)

Make a key on the API keys page; a test key is free and marks its results. Keep the key on your server, never in a browser or an app.

What it does

Call Does
Client(api_key, base_url=None, timeout=60) The client.
client.run(tool, files, options=None, retention_hours=None, timeout=None, on_progress=None) Create, upload, start, wait; returns the finished job or raises JobFailedError.
client.download(output, path=None) The bytes of one output, or written to path.
client.create_job(tool, files, options=None, retention_hours=None) POST /jobs; .job and .uploads.
client.upload(upload, data) PUT the bytes (or a path's) to one link.
client.start_job(id), client.get_job(id), client.cancel_job(id) The three job calls.
client.wait(id, interval=2.0, timeout=None, on_progress=None) Polls until the job ends.
client.tools(), client.account() GET /tools, GET /account.
verify_webhook(raw_body, signature_header, secret, tolerance=300) True when a webhook delivery is genuine and fresh.

A file is a path, or (name, bytes, content_type), or (name, file_object, content_type, size). A refused request raises ApiError (status, code, message, details, retry_after); a job that fails or is cancelled raises JobFailedError (.job, with job.error).

The tools, their options and the errors are documented at https://uvpdftool.com/developers.

Metadata

Release files for uvpdftool 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uvpdftool 0.1.0
File Size Uploaded Provenance Actions
uvpdftool-0.1.0.tar.gz 11.3 kB Without provenance Details for uvpdftool-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uvpdftool 0.1.0
File Interpreter ABI Platform Actions
uvpdftool-0.1.0-py3-none-any.whl Python 3 none any Details for uvpdftool-0.1.0-py3-none-any.whl

Total release size: 19.3 kB

Release files / uvpdftool-0.1.0.tar.gz

Download URL uvpdftool-0.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8835eac52ede42a3e6b6e8e26f5ab04f15bf6528f5ba95d2f55f6b18e0b7755f
BLAKE2b-256 checksum
How to use checksums
894d95a83154d5987d329e5e703995cd739346241ee441f0e5aefc2f9d84c5ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / uvpdftool-0.1.0-py3-none-any.whl

Download URL uvpdftool-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a9e54cd5d26b857a1893b9cb6e7feea0d06c77ef17c0685478e1caf7ea3bc51
BLAKE2b-256 checksum
How to use checksums
cae9fabc05bad7c55bc48c70c7ac60e10924f2bd0d0004a50854627feeae9403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for uvpdftool 0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page