Skip to main content

htmlcmp

Tool to compare (generated) HTML files visually and automatically using Selenium.

Provides various entry points to run:

  • compare-html is a CLI tool to compare two directory structures containing HTML files
  • compare-html-server starts a webserver and allows to inspect differences manually
  • html-render-diff renders two HTML files and produces images
  • html-tidy allows to run HTML tidy on a directory

Used for regression testing in https://github.com/opendocument-app/OpenDocument.core.

Reviewing differences in the browser

compare-html-server serves two pages:

  • the overview lists every comparable file with its status (same, different, pending), a search box, status filters with counts, and an update ref button per file plus Update all in view
  • the compare page (click a path) shows reference (A) and monitored (B) side by side with synchronised scrolling, a diff strip in between, and the controls to work through a review

On the compare page:

  • Update reference copies the monitored file over the reference one; the file is then marked ✓ accepted for the rest of the session (the mark disappears again if the monitored file changes afterwards)
  • ← / → step to the previous and next document; tick diffs only to skip files that already match
  • the diff strip maps the whole page into the column: red bars mark the regions that differ, the blue box marks the visible part of the document, and a click jumps both panes to that position
key action
← / k, → / j previous / next document
1 / 2 / 3 reference only / side by side / monitored only
d toggle the diff strip
u update the reference
r reload both panes
Esc back to the overview
? shortcut help

Comparison results are computed live, so the pages update themselves while the monitored directory is being regenerated. Accepted marks are kept in memory only and are gone after a restart.

Install via PyPI

pip install htmlcmp

Download and run the docker image

docker pull ghcr.io/opendocument-app/odr_core_test
docker run -ti \
  -v $(pwd):/repo \
  -p 8000:8000 \
  ghcr.io/opendocument-app/odr_core_test \
  compare-html-server /repo/REFERENCE /repo/MONITORED --compare --driver firefox --port 8000

Manually build the docker image

docker build --tag odr_core_test test/docker

Run locally

PYTHONPATH=$(pwd)/src:$PYTHONPATH python ./src/htmlcmp/compare_output_server.py \
  /path/to/REFERENCE \
  /path/to/MONITORED \
  --compare \
  --driver firefox \
  --port 8000 \
  -vv

Metadata

Release files for htmlcmp 2.4.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 htmlcmp 2.4.1
File Size Uploaded Provenance Actions
htmlcmp-2.4.1.tar.gz 32.1 kB With provenance Details for htmlcmp-2.4.1.tar.gz

Release files / htmlcmp-2.4.1.tar.gz

Download URL htmlcmp-2.4.1.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
df61cdb852daf6080b25a93374d96aae1aa3009397f7675b4c95a06d00792328
BLAKE2b-256 checksum
How to use checksums
906e9908a2c7f05778de9781ae69986699c9d831825cbad17a489c53a00e88fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

Security for htmlcmp 2.4.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.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for htmlcmp-2.4.1.tar.gz

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 27, 2026.

Transparency log

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