larzdiff
Human-readable diffs of two values — see exactly what changed.
When a test fails or two things should match but don't, you need to see the difference at a glance, not squint at two big blobs. larzdiff compares two values — strings, lists, dicts, or scalars — and describes exactly what changed: which keys, which lines, which items. Perfect for test failure messages and debugging. Zero third-party dependencies.
Install
pip install larzdiff
Use
from larzdiff import diff
print(diff({"a": 1, "b": 2}, {"a": 1, "b": 3})) # ~ 'b': 2 -> 3
print(diff([1, 2, 3], [1, 9, 3])) # ~ [1] 2 -> 9
print(diff("line one\nline two", "line one\nline 2"))
Learn to code with Larz
Part of the learn-to-code toolkit in the Larz stack — see the Learn to Code platform. Pairs with larztest.
Tests
python -m unittest discover -s tests -v # 7 tests
License
MIT (c) larz-scripter
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 larzdiff-0.1.0.tar.gz.
File metadata
- Download URL: larzdiff-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26c3b574ae419cbfe979ab89417067fef68b6697400bc53412672f1ae2422e17
|
|
| MD5 |
aba87640f3c9e706c79654caeb9198fd
|
|
| BLAKE2b-256 |
cb6e0374d9446c93064e80ea9ed40032a6d04967c5c83e37d1ca0465bb0ba273
|
File details
Details for the file larzdiff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: larzdiff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcc0cff384dac8ae2b30d25309bceceaa0c61d340b66a64d187d2299d27acdfe
|
|
| MD5 |
5179ce00003ebadeb3cdfd2c6bb68ae0
|
|
| BLAKE2b-256 |
adddd8fe175ad97a083ad830afd14a60b738875cbb9b0cc00dc8badc58b70ce2
|