Data and Math
vdifflib
Compares two texts, or two lists of lines, and shows what changed.
Released v1.0.0 · 2026-09-28use "stdlib/difflib.ven"
Compares two texts, or two lists of lines, and reports what changed, with a longest common substring search written in Venutian.
print find_longest_match("abcxyz", "xyzabc", 0, 6, 0, 6)
Reference (4 functions)
API reference
find_longest_match(a, b, alo, ahi, blo, bhi)
The single longest contiguous run shared between a[alo:ahi] and b[blo:bhi].
find_longest_match("abcxyz", "xyzabc", 0, 6, 0, 6)get_matching_blocks(a, b)
Every non-overlapping matching block between a and b, in order.
get_matching_blocks("abcxyz", "xyzabc")ratio(a, b)
ratio("abcxyz", "xyzabc")unified_diff(a_lines, b_lines, fromfile, tofile, context = 3)
Renders a unified diff between a_lines and b_lines as Text lines.
unified_diff(["one", "two", "three"], ["one", "two", "THREE"], "a.txt", "b.txt")