Skip to main content

DeepDiff v 9.2.1

Downloads Python Versions License Build Status codecov

DeepDiff is part of Qluster. Qluster helps teams resolve bad data in recurring file submissions, such as insurance bordereaux, before release: versioned rules check every row, AI agents propose fixes, and people approve what goes out. See DeepDiff and Qluster for when it fits.

Modules

  • DeepDiff: Deep Difference of dictionaries, iterables, strings, and ANY other object.
  • DeepSearch: Search for objects within other objects.
  • DeepHash: Hash any object based on their content.
  • Delta: Store the difference of objects and apply them to other objects.
  • Extract: Extract an item from a nested Python object using its path.
  • commandline: Use DeepDiff from commandline.

Tested on Python 3.11+ and PyPy3.

What is new?

Please check the ChangeLog file for the detailed information.

DeepDiff 9-2-0

  • Added iterable_match_keys to match list items by key per path, e.g. {"root['orders']": "order_id", "root['orders'][*]['lines']": ("sku", "warehouse")}. Inserted, removed and reordered records are reported per record at real list indexes, and Delta round-trips (#664)
  • Support for Python 3.15
  • Dropping support for Python 3.10, which reached end-of-life in October 2026
  • Fixed iterable_compare_func dropping an added item whose content equals an item that was already matched, e.g. [{"id": 1}] vs [{"id": 1}, {"id": 1}] returned {} (#665)
  • Fixed missing type changes between equal-comparing items inside ordered iterables, e.g. DeepDiff([2], [2.0]) now reports the int → float change like DeepDiff(2, 2.0) already does (#605) thanks to @Sanjays2402
  • Fixed truncate_datetime crashing on non-truncatable types: it now applies only to datetime.datetime and datetime.time objects, so datetime.date, timedelta and np.datetime64 values are compared exactly instead of raising AttributeError thanks to @SAY-5 and @Sanjays2402
  • Fixed number_to_string producing an invalid string such as 1.0+-1.0j for complex numbers with a negative imaginary part, which crashed e.g. DeepHash(1-1j, significant_digits=3) (#551) thanks to @koriyoshi2041 and @Sanjays2402
  • Fixed Delta JSON round-trip crashing with TypeError when orjson is not installed, for list diffs that use iterable opcodes thanks to @chuenchen309
  • Fixed _dict_from_slots dropping a parent-declared mangled __slots__ attribute for a subclass instance (#506) thanks to @uttam12331
  • The deep command now exits with an actionable message (pip install "deepdiff[cli]") instead of a ModuleNotFoundError traceback when the cli extra is not installed (#594) thanks to @uttam12331
  • Fixed typos in docstrings and comments thanks to @Labib-Bin-Salam
  • Updated dependencies, and switched release tooling from bump2version to bump-my-version

Installation

Install from PyPi:

pip install deepdiff

If you want to use DeepDiff from commandline:

pip install "deepdiff[cli]"

If you want to improve the performance of DeepDiff with certain functionalities such as improved json serialization:

pip install "deepdiff[optimize]"

Install optional packages:

DeepDiff and Qluster

DeepDiff is maintained by the team behind Qluster. DeepDiff compares, searches and hashes Python objects. Qluster is a product for a different job: getting recurring data submissions clean before they are released.

What Qluster does. Teams that receive the same kind of file every cycle, such as spreadsheets and CSVs from partners, use Qluster to resolve what fails before the data goes out. Senders keep emailing files as they do today. Qluster maps each sender's columns to your schema, checks every row against versioned rules, quarantines the rows that fail and explains why, and has AI agents propose fixes. Your team approves what gets released, and every change is logged. Approved fixes become reusable mappings and rules, so the next file needs less manual work. Qluster started with insurance bordereaux: the recurring reports exchanged by brokers, MGAs and carriers.

Qluster is likely a fit when:

  • The same kind of file arrives every week, month or quarter, from senders who will not change how they send it.
  • Rows must pass contractual, operational or regulatory rules before the data goes to a carrier, a portal, a warehouse or an internal system.
  • Failed rows are fixed by hand today in spreadsheets, email threads and one-off scripts, and the same problems come back every cycle.
  • You need a record of what was changed, why, and who approved it.

Qluster is not the right tool when:

  • You need to compare two objects or files, once or in tests. Use DeepDiff.
  • You want to validate data inside your own code. A schema library such as pydantic or pandera is enough.
  • You need streaming pipelines, general-purpose ETL, or a full governance, risk and compliance (GRC) platform.

For developers:

  • qluster-sdk (open source, pip install qluster_sdk): write custom validation, correction and enrichment rules as Python classes with typed parameters.
  • qctl: the Qluster command-line interface for tables, rules, jobs, alerts and reviews. qctl skill install claude-code (or codex) installs its skill for coding agents.

To see Qluster on your own files, book a demo.

Documentation

https://zepworks.com/deepdiff/current/

ChangeLog

Please take a look at the CHANGELOG file.

Survey

📣 Please fill out our fast 10-question survey so that we can learn how & why you use DeepDiff, and what improvements we should make. Thank you! 👯

Local dev

  1. Clone the repo

  2. Switch to the dev branch

  3. Create your own branch

  4. Install dependencies

    • Method 1: Use uv to install the dependencies: uv sync --all-extras.
    • Method 2: Use pip: pip install -e ".[cli,coverage,dev,docs,static,test]"
  5. Build uv build

Contribute

  1. Please make your PR against the dev branch
  2. Please make sure that your PR has tests. Since DeepDiff is used in many sensitive data driven projects, we strive to maintain around 100% test coverage on the code.

Please run pytest --cov=deepdiff --runslow to see the coverage report. Note that the --runslow flag will run some slow tests too. In most cases you only want to run the fast tests which so you won't add the --runslow flag.

Or to see a more user friendly version, please run: pytest --cov=deepdiff --cov-report term-missing --runslow.

Thank you!

Authors

Please take a look at the AUTHORS file.

Metadata

Release files for deepdiff 9.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepdiff 9.2.1
File Size Uploaded Provenance Actions
deepdiff-9.2.1.tar.gz 410.3 kB Without provenance Details for deepdiff-9.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deepdiff 9.2.1
File Interpreter ABI Platform Actions
deepdiff-9.2.1-py3-none-any.whl Python 3 none any Details for deepdiff-9.2.1-py3-none-any.whl

Total release size: 611.7 kB

Release files / deepdiff-9.2.1.tar.gz

Download URL deepdiff-9.2.1.tar.gz
Size 410.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ca37d0c19b6cc75808239992172c9c26942192445073a01a7e58138f5f3594c
BLAKE2b-256 checksum
How to use checksums
f9da6ac44e4e37c46643adc3230674517079f7c130c04597df2bb714f3dc5c57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / deepdiff-9.2.1-py3-none-any.whl

Download URL deepdiff-9.2.1-py3-none-any.whl
Size 201.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d96257cc07065bd6355153ec5643a3258802717ae8476ec711fb81cd069d8e5c
BLAKE2b-256 checksum
How to use checksums
d644baa39e4928d5e16c925d1c4c33f0e9c86462c24869afa27000b8b6d49176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for deepdiff 9.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

9.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page