Skip to main content

mostlyrender (Python)

Official Python SDK for the MostlyRender image, PDF & screenshot generation API. Zero dependencies (stdlib only), Python 3.9+.

pip install mostlyrender

Quick start

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

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

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

Async + webhooks

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

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)

# 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"})

Metadata

Release files for mostlyrender 0.2.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 mostlyrender 0.2.0
File Size Uploaded
mostlyrender-0.2.0.tar.gz 6.4 kB Details

Built distribution (wheel)

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

Total release size: 12.0 kB

Release files / mostlyrender-0.2.0.tar.gz

Download URL mostlyrender-0.2.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
af7a1d61a163ba761a17b7f9619c7300431b61ba6669d41abcb99eb4e688a2ad
BLAKE2b-256 checksum
How to use checksums
2bd2066dc790f135cde2ddddc230c89922f255c4f71433c9dd0825b09854f34f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / mostlyrender-0.2.0-py3-none-any.whl

Download URL mostlyrender-0.2.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fde12eeb948e7519fb04e312e49f61c263e895a0db70e652ca3ff23dc59f286
BLAKE2b-256 checksum
How to use checksums
26decc08c5fb06f6e5d37f5745f23b5cf45fb47ae1737736e37e8f29e77a7105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.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