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.1
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 |
|---|---|---|---|---|
| uvpdftool-0.1.1.tar.gz | 11.5 kB | Without provenance | Details for uvpdftool-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uvpdftool-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for uvpdftool-0.1.1-py3-none-any.whl |
Total release size: 19.5 kB
Release files / uvpdftool-0.1.1.tar.gz
| Download URL | uvpdftool-0.1.1.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
252a53e9af1ffde2454344e80a85ff4549c0408de0c6d3300f4bcc4c4129da7b
|
|
BLAKE2b-256 checksum How to use checksums |
3d790c88ed4b6c92736a865856ce6199099d72a567a37eba9fe911544c1f57a4
|
| 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.1-py3-none-any.whl
| Download URL | uvpdftool-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a26e3cff2cbdeb0cfa7b0a50f0997ef7910606ed12461d2667909e78eff5326
|
|
BLAKE2b-256 checksum How to use checksums |
5d25446b0685103b11acaef39191c3e8a3049c913108f08902e7ad72c5539df1
|
| 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.1
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.