Metadata-Version: 2.5
Name: mostlyrender
Version: 0.2.0
Summary: Official Python SDK for the MostlyRender image, PDF & screenshot generation API.
Project-URL: Homepage, https://mostlyrender.com
Project-URL: Documentation, https://mostlyrender.com/docs/sdks
Project-URL: Repository, https://github.com/mostlytiny/mostlyrender-python
Project-URL: Issues, https://github.com/mostlytiny/mostlyrender-python/issues
Author: Mostly Tiny
License-Expression: MIT
License-File: LICENSE
Keywords: api,image-generation,mostlyrender,og-image,pdf,qr,screenshot
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: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# mostlyrender (Python)

Official Python SDK for the [MostlyRender](https://mostlyrender.com) image, PDF &
screenshot generation API. Zero dependencies (stdlib only), Python 3.9+.

```sh
pip install mostlyrender
```

## Quick start

```python
from mostlyrender import MostlyRender

mr = MostlyRender("mr_live_…")  # create a key in the app → Settings

out = mr.render("tpl_abc", modifications={"title": "Renders that never go dark"})
print(out["url"])
```

## Batch — one call, many images

```python
res = mr.render_batch(template_id="tpl_abc", output="png",
                      items=[{"title": "One"}, {"title": "Two"}, {"title": "Three"}])
print(res["count"], res["ok"])
```

## Screenshot any URL

```python
shot = mr.screenshot("https://stripe.com", full_page=True)
```

## Async + webhooks

```python
job = mr.render_async("tpl_abc", modifications={"title": "Big PDF"}, output="pdf",
                      webhook_url="https://your.app/hooks/mostlyrender")  # optional, signed
final = mr.wait_for_render(job["id"])
print(final["result"]["url"])
```

## Other

```python
mr.list_templates()            # {"templates": [...]}
mr.get_account()               # {"plan": "...", "email": "...", "display_name": "..."}
mr.get_render(job_id)          # poll a single async job
```

Errors raise `MostlyRenderError` with `.status` and `.body`.

> **Base URL:** defaults to `https://api.mostlyrender.com`. Until that custom domain
> is attached, pass the live host: `MostlyRender(key, base_url="https://mostly-render-api.web.app")`.

## Signed URLs (for `<img>` / `og:image`)

```python
# Ask the API to sign one (uses your API key server-side):
url = mr.signed_url("tpl_abc", {"title": "Hello"})["url"]

# ...or sign locally with your URL-signing secret (Settings -> URL signing secret):
from mostlyrender import sign_render_url
og = sign_render_url(os.environ["MOSTLYRENDER_SIGNING_SECRET"], "tpl_abc", "png", {"title": "Hello"})
```
