DeepDiff compares, searches, and hashes nested Python objects deeply. Modules include Delta for reconstructing objects and a optional CLI extra.
Overview
DeepDiff is a Python library for deep difference reporting between arbitrary objects, including dictionaries, iterables, strings, and custom instances. Related modules add DeepSearch for locating nested values, DeepHash for content-based hashing of unhashable structures, Delta for storing and applying diffs, Extract for path-based retrieval, and a command-line interface via an optional extra.
It runs on CPython 3.11+ and PyPy3. Install from PyPI with optional cli or optimize extras for terminal use and faster JSON paths. Recent releases add iterable match keys for list diffing by business keys, distance calculation between objects, and fixes around complex numbers, datetime truncation, and Delta JSON round-trips.
DeepDiff targets testing, data validation, and change tracking, distinct from the separate Qluster product used for recurring file submission workflows. Versioned documentation includes changelog detail for each release.
Key features
- Deep structural object diffing
- Nested search within objects
- Content-based DeepHash
- Delta apply and reconstruct
- Path-based Extract helper
- Optional CLI extra
- Iterable keyed list comparison
- Distance calculation between values
Use cases
- Unit tests asserting complex object changes
- Tracking nested config or API payload drift
- Hashing structured data for caches
- Replaying object updates via Delta
- Command-line diff inspection