Metadata-Version: 2.5
Name: formfeed
Version: 0.1.0
Summary: Formfeed API client: template-based PDF and image generation (sync and async, httpx).
Project-URL: Homepage, https://formfeed.dev
Project-URL: Documentation, https://docs.formfeed.dev/api/sdks/python
Project-URL: Source, https://github.com/formfeed-dev/formfeed/tree/main/packages/sdk-python
Project-URL: Issues, https://github.com/formfeed-dev/formfeed/issues
Project-URL: Changelog, https://docs.formfeed.dev/changelog
Author-email: Formfeed <support@formfeed.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: api,formfeed,html-to-pdf,pdf,pdf-generation,sdk,templates
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.5
Description-Content-Type: text/markdown

# formfeed (Python)

Client for the Formfeed API: template-based PDF and image generation. Sync and async, built on
httpx, pydantic models, retries on 429 and 503 with the server's `Retry-After`, an
`Idempotency-Key` on every render, typed errors and webhook verification.

```bash
pip install formfeed
```

```python
from formfeed import Formfeed

client = Formfeed("ff_test_…")                      # region="us" or base_url="…" for other hosts
render = client.renders.create(template="invoice-de", data={"invoice": {"number": "2026-001"}})
open("invoice.pdf", "wb").write(client.renders.download(render))

job = client.renders.batch([{"data": d} for d in rows], template="invoice-de", zip=True)
job = client.jobs.wait_for(job.id)
```

```python
from formfeed import AsyncFormfeed

async with AsyncFormfeed("ff_test_…") as client:
    render = await client.renders.create(html="<h1>Hello</h1>", output="png")
```

Webhooks:

```python
from formfeed import parse_webhook_event

event = parse_webhook_event(secret, request.headers["Webhook-Signature"], request.body)
```

Errors raise `FormfeedError` with `code`, `status`, `problem` and `request_id`. Templates:
`client.templates.all()`, `.version("invoice-de", "latest")`, `.create_version(...)`, `.publish(...)`.

Documentation: <https://docs.formfeed.dev/api/sdks/python>
