Skip to main content

docrenders-sdk (Python)

Official Python SDK for the DocRenders API. No dependencies — uses the standard library only.

Installation

pip install docrenders-sdk

Usage

import os
from docrenders import DocRendersClient, RenderRequest, RenderFileRequest, RenderOptions

client = DocRendersClient(os.environ["PDFGEN_API_KEY"])

# Render to raw bytes
pdf = client.render(RenderRequest(
    markdown="# Invoice\n\nDue: **$1,200**",
    template="invoice",
    options=RenderOptions(format="A4"),
))

# Render and get a signed download URL (expires in 15 min)
result = client.render_signed_url(RenderRequest(markdown="# Report"))
print(result.url)

# Upload a file
with open("invoice.md", "rb") as f:
    pdf = client.render_file(RenderFileRequest(
        filename="invoice.md",
        content=f.read(),
    ))

# Check usage
usage = client.usage()
print(f"{usage.renders_used} / {usage.renders_limit} renders used")

Error handling

from docrenders import DocRendersClient, DocRendersError, RenderRequest

try:
    pdf = client.render(RenderRequest(markdown="# Hello"))
except DocRendersError as e:
    print(e.code, str(e))  # e.g. "quota_exceeded"

Metadata

Release files for docrenders-sdk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docrenders-sdk 0.2.1
File Size Uploaded Provenance Actions
docrenders_sdk-0.2.1.tar.gz 4.5 kB Without provenance Details for docrenders_sdk-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docrenders-sdk 0.2.1
File Interpreter ABI Platform Actions
docrenders_sdk-0.2.1-py3-none-any.whl Python 3 none any Details for docrenders_sdk-0.2.1-py3-none-any.whl

Total release size: 8.5 kB

Release files / docrenders_sdk-0.2.1.tar.gz

Download URL docrenders_sdk-0.2.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
395f7a102c62033dd4332cee50139a576aa3e5090caf6a1876c61eeef6c262e0
BLAKE2b-256 checksum
How to use checksums
07a7266ae3f65c23d7220357a3aaa40ce1473290017a5e968b48a2262372e9a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / docrenders_sdk-0.2.1-py3-none-any.whl

Download URL docrenders_sdk-0.2.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83c5fbed109d6be20f69c4de4a570d136315e9512caa8cb142aa7683fbdbe181
BLAKE2b-256 checksum
How to use checksums
0d3b88dd7483c2e3f18ce11a54931588ae8772a45522c08ae6eff853ce9ae48a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for docrenders-sdk 0.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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