Diff2HTML
Python's difflib is a great standard library feature.
But I wanted a command line version.
Installation
pip install diff2html
Usage
diff2html fileA fileB --output diff.html
firefox diff.html
Full help
usage: Compare two files and produce a well formatted diff in an HTML file.
A command line wrapper for Python's difftool.
[-h] [-l STRIP_LEFT] [-r STRIP_RIGHT] [-t TITLE] [-n NOTES] [-o OUTPUT]
left right
positional arguments:
left The first file to compare.
right The second file to compare.
options:
-h, --help show this help message and exit
-l, --left-strip STRIP_LEFT
Regex expression acting on the left hand side of the
diff
-r, --right-strip STRIP_RIGHT
Regex expression acting on the right hand side of the
diff
-t, --title TITLE Add a title to the page, other than the names of the
files being compared. If set the names of the files
being compared will be added as a subtitle.
-n, --notes NOTES Additional notes to be added below the title and
subtitle.
-o, --output OUTPUT Output file path. If unset output will be printed to
stdout.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
diff2html-1.0.1.tar.gz
(4.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diff2html-1.0.1.tar.gz.
File metadata
- Download URL: diff2html-1.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
740bc7c56e2bc4ab3b8729c5a376382234505c3d457e1d29b13f676620a39eaf
|
|
| MD5 |
1a6488f87924b2aefb60a709f6cab37c
|
|
| BLAKE2b-256 |
f8d348cc0296722a9088a5c262ff504816df3bd6f0c59708cf89be19b640fd22
|
File details
Details for the file diff2html-1.0.1-py3-none-any.whl.
File metadata
- Download URL: diff2html-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
568b84896d7d05ceb572af17e57423486974175e835980d0581e55d00f4ddfe2
|
|
| MD5 |
91e9b9879be40db32e82d5e64dc2479b
|
|
| BLAKE2b-256 |
cdaca9726a31df0d8a82ec203d0d1e50d484fc5f205c6afde3f2c55f39c946c9
|