Installation
Hosted API
The API client uses only the Python standard library. Create templates in the dashboard, then render them with data:Client options
Methods
| Method | Description | Returns |
|---|---|---|
render(slug, data) | Synchronous render | bytes |
render(slug, data, s3=opts) | Render and upload to S3 | dict |
render_async(slug, data) | Start async render job | dict |
get_job(job_id) | Poll async job status | dict |
merge(pdfs) | Merge multiple PDFs | bytes |
certify(pdf, certificate=..., private_key=...) | Certify a PDF with X.509 certificate | bytes |
redact(pdf, patterns=..., presets=...) | Redact content from a PDF | bytes |
extract(pdf_bytes) | Extract embedded data | dict or None |
Certify
Redact
Merge
Error handling
Native templates
Build documents in Python code using a component DSL that mirrors the JSX API. Renders locally via the WASM engine — no network calls.Components
| Constructor | Description | Key options |
|---|---|---|
Document(*children) | Root container, .render() returns PDF bytes | title, author, lang, tagged, pdf_ua, pdfa, flatten_forms |
Page(*children) | Page container | size (e.g. "A4"), margin |
View(*children) | Flex/grid container | flex_direction, gap, padding, justify_content, align_items |
Text(content) | Text element | font_size, font_weight, color, text_align |
Image(src) | Image (file path, URL, or data URI) | width, height, alt |
Table(*rows) | Table with auto-repeating headers | columns |
Row(*cells) | Table row | header=True |
Cell(*children) | Table cell | col_span, row_span |
QrCode(data) | Vector QR code | size, color |
Barcode(data) | 1D barcode | format, width, height |
BarChart(data) | Bar chart | width, height, title |
LineChart(series, labels) | Line chart | width, height, title |
PieChart(data) | Pie/donut chart | width, height, donut |
TextField(name) | Fillable text field | value, placeholder |
Checkbox(name) | Fillable checkbox | checked |
Dropdown(name, options) | Fillable dropdown | value |
Watermark(text) | Rotated watermark | font_size, color, angle |
PageBreak() | Force a page break | — |
Local certify
Hosted vs native
| Hosted API | Native templates | |
|---|---|---|
| Dependencies | Zero (stdlib only) | wasmtime (~6MB WASM) |
| Templates | Pre-uploaded via dashboard | Built in Python code |
| Network | Requires API call | Fully offline |
| Use case | Dynamic data + stored templates | Full control, CI/CD, testing |