htmldiff2
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)
| File | Size | Uploaded | |
|---|---|---|---|
| htmldiff2-0.2.2.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|