icdiff is a Python library and command-line utility for displaying diffs with improved colorization, making it easier to read changes side-by-side. It aims to be a more user-friendly alternative to traditional `diff` output. The current version is 2.0.10, and it maintains a fairly active release cadence with updates typically every few months.
Install & Compatibility
Where this runs
tested against v2.0.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.930 runs
installs and imports cleanly · install 0.0s · import 0.037s · 17.9MB
glibcpy 3.10–3.930 runs
installs and imports cleanly · install 1.5s · import 0.029s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
This is the main class for programmatic diff generation with console-style output.
from icdiff import ConsoleDiff
This quickstart demonstrates how to use `ConsoleDiff` to generate a colored, side-by-side diff between two lists of strings. It configures the diff for a specific column width, includes line numbers, and sets custom file labels for the header.
from icdiff import ConsoleDiff
old_text = [
"line 1: hello world",
"line 2: foo bar",
"line 3: baz qux"
]
new_text = [
"line 1: hello earth",
"line 2: foo baz",
"line 3: baz qux",
"line 4: new line"
]
differ = ConsoleDiff(
cols=80, # Specify number of columns for display
line_numbers=True, # Show line numbers
color=True # Enable color output
)
diff_lines = differ.make_table(
old_text,
new_text,
fromfile='old_version.txt',
tofile='new_version.txt',
context=True # Show context lines
)
for line in diff_lines:
print(line)
icdiff --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.