Metadata-Version: 2.4
Name: rendral
Version: 0.5.0
Summary: Official Python client for the Rendral — HTML→PDF, screenshots, OG images, merge, watermark, PDF page tools, templates, async jobs, batch, signed URLs.
Author: Rendral
License: MIT
Project-URL: Homepage, https://rendral.com
Project-URL: Repository, https://github.com/colinp227/Rendral
Project-URL: Issues, https://github.com/colinp227/Rendral/issues
Keywords: pdf,html-to-pdf,screenshot,og-image,watermark,rendral,api-client
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# rendral (Python)

Official Python client for the Rendral. Standard library only — no dependencies.

```bash
pip install rendral
```

## Quickstart

```python
import os
from rendral import RenderClient

client = RenderClient(os.environ["RENDER_API_KEY"])

# HTML → PDF
pdf = client.pdf(html="<h1>Invoice #1042</h1>", options={"pageNumbers": True, "format": "A4"})
with open("invoice.pdf", "wb") as f:
    f.write(pdf)

# A live URL → PDF
client.pdf(url="https://example.com")
```

## Everything it does

```python
# Screenshot (PNG/JPEG/WebP, full page, or one element)
client.screenshot(url="https://example.com", options={"fullPage": True})
client.screenshot(html=html, options={"selector": "#card", "omitBackground": True})

# 1200×630 Open Graph image
client.og(title="Ship faster", eyebrow="Changelog", theme="dark")

# Merge PDFs
client.merge([pdf_a, pdf_b])  # list[bytes]

# Watermark every page
client.watermark(pdf, "CONFIDENTIAL", options={"opacity": 0.15, "rotate": 45})
```

## Errors

Non-2xx responses raise `RenderError` with the API's machine-readable code and request id:

```python
from rendral import RenderError

try:
    client.pdf(html=html)
except RenderError as e:
    print(e.status, e.code, e.request_id)  # e.g. 402 "quota_exceeded" "a1ab…"
```

## Options

`RenderClient(api_key, base_url=...)` — override `base_url` to point at your deployment.
Every method returns `bytes`. See the API docs for the full option reference.
