Skip to main content

htmldiff2

Tests

htmldiff2 is a library that uses difflib, genshi and html5lib to diff arbitrary fragments of HTML inline. htmldiff2 is a friendly fork of Armin Ronacher's htmldiff which needed to be upgraded for the diffengine project. See this issue for context.

>>> from htmldiff2 import render_html_diff
>>> render_html_diff('Foo <b>bar</b> baz', 'Foo <i>bar</i> baz')
u'<div class="diff">Foo <i class="tagdiff_replaced">bar</i> baz</div>'
>>> render_html_diff('Foo bar baz', 'Foo baz')
u'<div class="diff">Foo <del>bar</del> baz</div>'
>>> render_html_diff('Foo baz', 'Foo blah baz')
u'<div class="diff">Foo <ins>blah</ins> baz</div>'

Develop

python -mvenv .venv
source .venv/bin/activate
python -m pip install -e .
python test.py

Publish

python -m pip install setuptools build twine
python -m build
python -m twine upload dist/*

Metadata

Release files for htmldiff2 0.2.2

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

Source distribution (sdist)

Source distribution for htmldiff2 0.2.2
File Size Uploaded
htmldiff2-0.2.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for htmldiff2 0.2.2
File Interpreter ABI Platform
htmldiff2-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / htmldiff2-0.2.2.tar.gz

Download URL htmldiff2-0.2.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0539673b590ef0976a9025c5e05468093bc37aabd1dda16a8ccbbce52f97870f
BLAKE2b-256 checksum
How to use checksums
7b954925479e76e60539cf985852423898d1dad9f151923ef4e0b6d86036a21d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release files / htmldiff2-0.2.2-py3-none-any.whl

Download URL htmldiff2-0.2.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02bdda8c151ea51076f75ed0717d2574ffd6fc7cc9c5c546dabbb3135daa62f6
BLAKE2b-256 checksum
How to use checksums
1cce7f66da27ad9caec7e4d5b482286d3bc103b49cab9f299f0139586f2be00a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.1

1 release file

0.1.0

1 release file

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