Docs

Quickstart: Python

Use this when you are in Python and want the official relaypdf client. Request JSON field names match REST; methods are snake_case. For the full method list, see the Python SDK guide.

Python methods use snake_case and the same REST field names. For the full client surface, see the Python SDK guide.

Install

Install from PyPI. api_key is required — load it from the environment.

Install
pip install relaypdf

HTML to PDF

from_html returns a BinaryResult with save().

main.py
import os
from relaypdf import RelayPDF

client = RelayPDF(api_key=os.environ["RELAYPDF_API_KEY"])
client.pdf.from_html("<h1>Hello</h1>", filename="hello.pdf").save("hello.pdf")