Metadata-Version: 2.4
Name: floosher
Version: 1.0.4
Summary: Official Floosher SDK — render PDF/PNG jobs and verify webhooks
License: MIT
Requires-Python: >=3.9
Requires-Dist: httpx<1.0,>=0.27
Requires-Dist: pydantic<3.0,>=2.0
Description-Content-Type: text/markdown

# floosher

Official Python SDK for [Floosher](https://floosher.dev) — convert HTML/CSS/Handlebars templates into PDFs and PNGs via a simple API.

## Install

```bash
pip install floosher
```

## Usage

```python
from floosher import FloosherApi

client = FloosherApi(token="YOUR_API_KEY")

job = client.render.pdf(
    template_id="your-template-id",
    data={"name": "Fahama"},
    webhook_url="https://yourapp.com/hooks/floosher",
)

print(job.job_id)

status = client.jobs.get(job.job_id)
print(status.status, status.output_url)
```

## Verifying webhooks

```python
from floosher import construct_event, SignatureVerificationError

@app.route("/hooks/floosher", methods=["POST"])
def floosher_webhook():
    try:
        event = construct_event(
            request.data,
            request.headers.get("X-Floosher-Signature"),
            os.environ["FLOOSHER_WEBHOOK_SECRET"],
        )
        print(f"Job {event.job_id} is now {event.status}")
        return "", 200
    except SignatureVerificationError:
        return "Invalid signature", 400
```

More docs and framework examples coming.

## License

MIT
