Skip to main content

Capture a PNG screenshot of a local HTML presentation using Playwright

Project description

html-snapshot

Capture any HTML page as a PNG and (optionally) emit a structured layout report for automated checks.

Quick start (no install)

# one-time: ensure Playwright's Chromium runtime is available
uvx playwright install chromium

# generate a slide screenshot, plus an optional JSON layout report
uvx html-snapshot /path/to/slide.html \
    --output slide.png \
    --report slide.json

uvx runs the tool in an isolated environment downloaded from PyPI. The script auto-installs Chromium if it is missing (skip with --no-auto-install).

Install once, reuse often

Prefer a persistent CLI?

uv tool install html-snapshot   # adds `html-snapshot` to your PATH

html-snapshot /path/to/slide.html --output slide.png --report slide.json

Or use pip:

pip install html-snapshot
html-snapshot /path/to/slide.html --output slide.png

CLI options

Option Description
html_path Path to the local HTML file to render
-o / --output Output PNG path (default: input with .png suffix)
--report Optional JSON layout report (words, bounding boxes, warnings)
--width / --height Viewport size (default: 1400×900)
--delay Wait time after load before capture
--no-full-page Capture only the viewport
--no-auto-install Require Chromium to be pre-installed

Direct-from-GitHub fallback

If you’d rather run the latest commit without PyPI:

uvx --from git+https://github.com/oneryalcin/html-snapshot html-snapshot sample.html --output slide.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html_snapshot-0.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html_snapshot-0.1.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file html_snapshot-0.1.3.tar.gz.

File metadata

  • Download URL: html_snapshot-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for html_snapshot-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8e75c9eaf450ddc0c42bbb8de36dcdc7abff5b5800fccae1aa147a54d5a24c54
MD5 3e4b1eca1e15127a8c7bf1e65dfc020c
BLAKE2b-256 f24a08df6d130d152f4e7c010211ae9bdd63ceb7c466d2240657351817d3c8b7

See more details on using hashes here.

File details

Details for the file html_snapshot-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for html_snapshot-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0fa501f7d0e087dfb21c4c332c52384f7e42aea9a8be2b1b84d5c87ee9c7958
MD5 14ba24df8affe29782cad7281bce2ddf
BLAKE2b-256 7faf1f0aa54a7d06fe7c09c76efcfd2ebc524163d61cd1f1143182a7292c952b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page