skillfed

datadiff

DataDiff is a library to provide human-readable diffs of python data structures.

datadiff v2.2.0 101.2K downloads/30d#12,957 on PyPI
Permissive license Abandoned released

What it is and what it does

DataDiff is a utility library that compares Python data structures and outputs the differences in a unified diff format, similar to what you'd see comparing text files. It recursively diffs dictionaries and sequences, and has special handling for multi-line strings. The library also provides drop-in replacements for test assertions (like `assert_equal`) that display a data diff when the assertion fails, making it easier to spot what actually differs in complex nested structures during test failures.

The package has no runtime dependencies and installs cleanly. However, it has been abandoned with no active maintenance, so it should be considered stable but not actively developed. It was originally designed to support Python 2.6 through Python 3, though current compatibility with recent Python versions is untested.

Use it for:

  • Debugging test failures by displaying a clear diff of expected vs. actual data structures in assertions
  • Comparing complex nested dictionaries or lists to quickly identify which fields or elements changed
  • Generating human-readable output when validating API responses or configuration objects in tests
  • Inspecting differences in large data structures without manually walking through nested levels

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates human-readable diffs of Python data structures (dicts, lists, tuples, sets, strings) and provides drop-in assertion replacements for test frameworks.

Yes, if you need readable diffs for test debugging and don't require active maintenance. The package is stable, has no dependencies, and works for its stated purpose. However, avoid it if you need ongoing support or compatibility assurance with current Python versions.

Install

datadiff on PyPI

pip

pip install datadiff

uv

uv add datadiff

poetry

poetry add datadiff

Installing datadiff

Before you install

Low install friction with no runtime dependencies. Package is abandoned (last release 1083 days ago, status marked abandoned), so no active maintenance or bug fixes should be expected.

License in practice

Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute freely with minimal restrictions.

Quickstart

pip install datadiff

from datadiff import diff
a = {'foo': 1, 'bar': 2}
b = {'foo': 1, 'bar': 4}
print(diff(a, b))

Verify before relying

  • Whether the package works reliably on modern Python versions given its abandoned status
  • Whether there are known compatibility issues with current testing frameworks or data structures

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,083 days since the last release
First released
Downloads 101,179/month — #12,957 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: datadiff-2.2.0-py2.py3-none-any.whl

Keywords: data, diff

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

python data structure diffdict list comparison outputtest assertion diff displayreadable data structure diffnested data comparisonunified diff for python objects
testing-utilitiesdata-comparison

More Python Modules packages