Skip to content

Feature Request: Option to Include Matched Values in DeepDiff Output #553

@jeetenp

Description

@jeetenp

Hi,
First off, thank you for building and maintaining such a powerful and useful tool — DeepDiff has become an integral part of our workflows for detecting changes between complex data structures.

I have a suggestion that might seem small, but could be quite impactful in many use cases:
Feature Proposal:
Currently, DeepDiff focuses solely on reporting the parts of the data that are different — which is great. However, in some scenarios, it would be extremely helpful if we could also retrieve the levels or paths where values matched between the two structures.

This could be implemented as an optional feature — for example:
DeepDiff(obj1, obj2, include_matched_values=True)

Benefits:
Allows users to build complete diff+match reports.

Useful for visual comparison tools, logging, data synchronization, or data auditing.

Enables post-processing and understanding of not just what changed, but also what remained the same — important in many traceability and testing scenarios.

Suggested Implementation (idea-level):
If include_matched_values=True, DeepDiff could include a new key in its output, e.g., "matched_values" (or "matched_paths"), listing the object paths that were checked and found to be equal.

This would be disabled by default to preserve performance and output size for current users.

Again, thank you for your work on this great library. I hope this idea is helpful and worth considering!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions