Learn to Code ยท zero-dependency ยท MIT

larzdiff

Human-readable value diffs.

When a test fails or two things should match but don't, you need to see the difference at a glance. larzdiff compares two values - strings, lists, dicts, scalars - and describes exactly what changed: which keys, which lines, which items. For test messages and debugging.

larzscript pkg install diff
View on GitHub →Learn the stack

What you get

Try it

import "diff" as diff
print(diff.lines("line one\nline two\nline three", "line one\nline TWO\nline three"))
print(diff.dicts({"a": 1, "b": 2}, {"a": 1, "b": 3, "c": 4}))
Output
  line one
- line two
+ line TWO
  line three
{added: {c: 4}, removed: {}, changed: {b: {old: 2, new: 3}}}

Why it's in the Larz Stack

larzdiff is a real Larzscript package (larzscript pkg install diff) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.