Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

weblitz

HTML, URLs, RDLC reports and Markdown to PDF, Word, Excel and PowerPoint, as Chrome prints them, with no browser.

import weblitz

weblitz.render_html("<h1>Hello</h1>", format="A4", margin={"top": "2cm"}).save("hello.pdf")
weblitz.render_url("https://example.com", print_background=True, path="example.pdf")
weblitz.render_html(page, output="xlsx").save("page.xlsx")
weblitz.render_url("https://example.com", output="png", viewport={"width": 1280, "device_scale_factor": 2}, path="example.png")

The options of render_html and render_url are Playwright's page.pdf() options by their Python names. Every call answers a Result (file, content_type, extension, pages, notes, trial) or raises WeblitzError, whose code says why.

output="png" (or "jpeg", "webp", "tiff") draws the page instead of printing it, with Playwright's screenshot names: by default the whole page as a screen shows it, in one image, laid out in an 800 by 600 window in screen media; capture="viewport" (or full_page=False) the window alone; capture="pages" each printed page as the PDF prints it (paper, margins, page_ranges), answered as a ZIP of page-1.png, page-2.png... (a TIFF holds every page in one file). viewport={"width": ..., "height": ..., "device_scale_factor": 2} sets the window and the image's pixels per CSS pixel, quality a JPEG's or WebP's (0 to 100).

Calls go to a pool of worker processes kept warm, started on first use. weblitz.configure(...) sets its options (workers, concurrency, license, timeout in milliseconds...); weblitz.Engine is a pool of your own and weblitz.AsyncEngine the same for asyncio (cancelling the awaiting task cancels the render).

The wheel's worker is not compiled ahead of time, which keeps the wheel within PyPI's size limit: a new worker's first render takes longer than with the npm package, and the renders after it are as fast. Render from one long-running process rather than a process per document, and call weblitz.info() at start-up when the first request should not wait for a worker to start.

Without a licence key (license= or the environment's SSRS2_LICENSE) PDF and image pages carry a trial watermark.

Wheels exist for Linux with glibc (x64, arm64) and macOS on Apple silicon; Alpine and other musl systems are not supported yet.

Metadata

Release files for weblitz 2.0.0rc1

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

Source distribution (sdist)

Source distribution for weblitz 2.0.0rc1
File Size Uploaded Provenance Actions
weblitz-2.0.0rc1.tar.gz 23.2 kB Without provenance Details for weblitz-2.0.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for weblitz 2.0.0rc1
File Actions
weblitz-2.0.0rc1-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for weblitz-2.0.0rc1-py3-none-win_arm64.whl
weblitz-2.0.0rc1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for weblitz-2.0.0rc1-py3-none-win_amd64.whl
weblitz-2.0.0rc1-py3-none-manylinux_2_27_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64 Details for weblitz-2.0.0rc1-py3-none-manylinux_2_27_x86_64.whl
weblitz-2.0.0rc1-py3-none-manylinux_2_27_aarch64.whl Python 3 none Linux glibc 2.27+ ARM64 Details for weblitz-2.0.0rc1-py3-none-manylinux_2_27_aarch64.whl
weblitz-2.0.0rc1-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details for weblitz-2.0.0rc1-py3-none-macosx_13_0_x86_64.whl
weblitz-2.0.0rc1-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details for weblitz-2.0.0rc1-py3-none-macosx_13_0_arm64.whl

Total release size: 529.9 MB

Release files / weblitz-2.0.0rc1.tar.gz

Download URL weblitz-2.0.0rc1.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
72468de66bdfc2a4380a15d2aaa33f7935649e95ad70f86e8cebf37981252066
BLAKE2b-256 checksum
How to use checksums
977adacdce89da12c608de8adf09fbf02bdf8ad509145461d5cb369aed2adbfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-win_arm64.whl

Download URL weblitz-2.0.0rc1-py3-none-win_arm64.whl
Size 84.2 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
0f78c576342bdea2dd58d78303823b3c446b414fcc8cb4040be8ec446471d610
BLAKE2b-256 checksum
How to use checksums
c9e5945db4a1a8648dde54b6999b3dac83f5c5b5c693ce638051b75d2b0f5dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-win_amd64.whl

Download URL weblitz-2.0.0rc1-py3-none-win_amd64.whl
Size 87.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1bff00b234a05fa9b1bda4947cb912bb2735d1e5e7529e1048ca9c4f79391d29
BLAKE2b-256 checksum
How to use checksums
10661091d7f1871523ff5d16823e54679a2947d826e89db471bba10a2ec4ec66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-manylinux_2_27_x86_64.whl

Download URL weblitz-2.0.0rc1-py3-none-manylinux_2_27_x86_64.whl
Size 89.6 MB
Tags Linux glibc 2.27+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a2fba01ba5a6416c83e7c7b73e9bdaf6a8049372da1ae9da602a37ddc7433105
BLAKE2b-256 checksum
How to use checksums
ff1df7690180e1925301f4e44b2a7cfec7850fe0e4feb5dea2a0e33f7c7dec97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-manylinux_2_27_aarch64.whl

Download URL weblitz-2.0.0rc1-py3-none-manylinux_2_27_aarch64.whl
Size 86.4 MB
Tags Linux glibc 2.27+ ARM64 Python 3
SHA-256 checksum
How to use checksums
61e915d262e551222b00853aef1526e873d4ecb4babb125e4e3fd210c24be6e6
BLAKE2b-256 checksum
How to use checksums
3a16860762594b82dde7963f927318efca0d0501dffb88b8869baa55387d32ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-macosx_13_0_x86_64.whl

Download URL weblitz-2.0.0rc1-py3-none-macosx_13_0_x86_64.whl
Size 93.1 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
3ade7dfa65f47230a07f88932e9f9b52ee2ed86fec9c831865ec26d6e2aa9f88
BLAKE2b-256 checksum
How to use checksums
04d5feb1b4aa18a07a5f7b765319379589ea5d729682f0e868e30c61a60fdb76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / weblitz-2.0.0rc1-py3-none-macosx_13_0_arm64.whl

Download URL weblitz-2.0.0rc1-py3-none-macosx_13_0_arm64.whl
Size 89.2 MB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
3c26f46e7a1ad506b1c3f199d9486f69e1d96a0a46886c43326d8737f7d207aa
BLAKE2b-256 checksum
How to use checksums
f892e3e632d6ac1ddfaea34764286b7095027e3572ffe7be52827fc0936059d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for weblitz 2.0.0rc1

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