Skip to content

Quick start

This page walks through your first render — from key to PDF — without touching the dashboard.

Export your key into the environment your script runs in:

Terminal window
export POLI_PAGE_API_KEY=pp_test_...
from poli_page import PoliPage
client = PoliPage() # picks up POLI_PAGE_API_KEY from the environment
pdf = client.render.pdf({
"project": "billing",
"template": "invoice",
"data": {"invoiceNumber": "INV-001", "total": 1280},
})

pdf is bytes. Write it to disk, upload it to S3, or return it directly from a web handler.

from pathlib import Path
from poli_page import PoliPage
client = PoliPage() # picks up POLI_PAGE_API_KEY from the environment
pdf = client.render.pdf({
"project": "billing",
"template": "invoice",
"data": {"invoiceNumber": "INV-001", "total": 1280},
})
Path("./invoice.pdf").write_bytes(pdf)