--- id: dictdiffer version: "0.10.0" license: MIT license_treatment: permissive maintenance: active --- # dictdiffer — Dictdiffer is a library that helps you to diff and patch dictionaries. License: permissive · Maintenance: active · Downloads: 9.3M/mo ## What it is and what it does Dictdiffer is a utility library for computing structural differences between Python dictionaries and applying those differences as patches. It identifies what keys were added, removed, or changed between two dicts and can reconstruct one dict from another by replaying those changes. The library has no external runtime dependencies and works as a pure Python module. Typical use cases include tracking configuration changes, auditing data mutations, implementing undo/redo logic, or syncing state between systems. It's particularly useful when you need to log or transmit only the delta between two versions rather than the full state. Use it for: - Track configuration file changes by diffing before and after versions to log only what changed. - Implement undo/redo functionality by storing diffs and replaying them forward or backward. - Audit data mutations in applications by capturing diffs of object state at key points. - Sync state between systems by transmitting only the delta rather than full snapshots. - Compare API responses or database records to detect and report structural changes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Dictdiffer computes and applies diffs and patches to Python dictionaries, letting you identify what changed between two dicts and reconstruct one from another. Yes. Dictdiffer is actively maintained, has no dependencies, installs cleanly, carries a permissive MIT license, and solves a real problem with a stable API. It's in the top 5000 packages by download volume and has no known vulnerabilities. Install it if you need to diff or patch dictionaries. ## Install pip install dictdiffer uv add dictdiffer poetry add dictdiffer ## Installing dictdiffer Before you install: Low friction: pure Python wheel with no runtime dependencies. Active maintenance—last release 29 days ago, repository not archived, and 849 stars indicate steady use. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install dictdiffer from dictdiffer import diff, patch old = {'a': 'x', 'b': 'y'} new = {'a': 'x', 'b': 'z', 'c': 'w'} changes = list(diff(old, new)) patched = patch(changes, old) Requires Python 3.7 or later. Verify before relying: - Whether the package handles deeply nested dictionaries or has performance limits on large structures. - Whether patch application is reversible or supports conflict resolution in concurrent scenarios. - Specific behavior when diffing or patching lists or other non-dict collection types. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 9.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags dictionary diff and patch, compare python dicts, dict change detection, dictionary comparison library, apply dict patches, find dict differences, nested dictionary diff, data-comparison, state-tracking [View on SkillFed](https://skillfed.io/packages/dictdiffer) · [View on PyPI](https://pypi.org/project/dictdiffer/)