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.1.tar.gz (6.1 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.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for html_snapshot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 10a96bc5246663ef69742acaf6f07fc797a0a32acede43b05ded0d3fbea70754
MD5 79d83898f91cb69cb45b16349bd2ad44
BLAKE2b-256 9a0c158bbb2f4beed5b5c8d6d7793302d7a1a4efb4710d51bb89897de045f678

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for html_snapshot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8210815ad8bd4c21a2349184cebc1050bb293ae593075fa5d6eeaa1fd112048
MD5 78e0025faf874cbaa91b1d6c6fc45534
BLAKE2b-256 fceb63f233fc65767f0cb24ccc76d30681913cbac1db9cfb8148ea47336b4ea4

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