Skip to main content

rendoc

Official Python SDK for the rendoc PDF generation API.

  • Sync and async clients
  • Full type hints
  • Python 3.9+

Installation

pip install rendoc

Quick start

Sync

from rendoc import Rendoc

client = Rendoc(api_key="rnd_...")

# Generate a PDF from markup
doc = client.documents.generate(
    markup="<h1>{{title}}</h1>",
    data={"title": "Hello World"},
    paper_size="A4",
)
print(doc.download_url)

# Generate from a template
doc = client.documents.generate(template_id="tmpl_123", data={"name": "John"})

# List templates
templates = client.templates.list()
invoices = client.templates.list(category="INVOICE")

# Check usage
usage = client.usage.get()
print(f"{usage.usage.documents}/{usage.usage.limit} documents used")

Async

import asyncio
from rendoc import AsyncRendoc

async def main():
    client = AsyncRendoc(api_key="rnd_...")
    doc = await client.documents.generate(
        markup="<h1>Hi</h1>",
        data={},
    )
    print(doc.download_url)
    await client.close()

asyncio.run(main())

Context manager

# Sync
with Rendoc(api_key="rnd_...") as client:
    doc = client.documents.generate(markup="<h1>Hi</h1>", data={})

# Async
async with AsyncRendoc(api_key="rnd_...") as client:
    doc = await client.documents.generate(markup="<h1>Hi</h1>", data={})

Error handling

from rendoc import Rendoc, AuthenticationError, RateLimitError, RendocError

client = Rendoc(api_key="rnd_...")

try:
    doc = client.documents.generate(markup="<h1>Hi</h1>", data={})
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Too many requests — slow down")
except RendocError as e:
    print(f"API error: {e.message} (status {e.status_code})")

Custom base URL

client = Rendoc(api_key="rnd_...", base_url="https://custom.rendoc.dev")

Documentation

Full API reference at https://rendoc.dev/docs.

Metadata

Release files for rendoc 1.0.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 rendoc 1.0.0
File Size Uploaded
rendoc-1.0.0.tar.gz 6.1 kB Details

Built distribution (wheel)

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

Total release size: 13.5 kB

Release files / rendoc-1.0.0.tar.gz

Download URL rendoc-1.0.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c22eecdd74ad3db174287133c8e692dde451f68185dc2ee7fe444676defe695b
BLAKE2b-256 checksum
How to use checksums
5f692e7e5b5312e4c23ecaabe7fc07bf2cd3c221a9f13849001ff9d03f81ea09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / rendoc-1.0.0-py3-none-any.whl

Download URL rendoc-1.0.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5e8b29de3516169de18887ed6e27ea91fbc7afd7f76b65f269d4eb2c7cbf019
BLAKE2b-256 checksum
How to use checksums
0882d279921220faf430e2f1a69aee1f6d45e360df1585f140c479d19e52b4dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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