dictdiffer
Dictdiffer is a library that helps you to diff and patch dictionaries.
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 on this page — 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
dictdiffer on PyPI
pip
pip install dictdifferuv
uv add dictdifferpoetry
poetry add dictdifferInstalling 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 the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,288,516/month — #1,549 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dictdiffer-0.10.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
datadiffGenerates human-readable diffs of Python data…
permissive · top 15,000 on PyPI
jsondiffComputes structured diffs between JSON and…
permissive · top 5,000 on PyPI
diff-match-patchProvides diff, match, and patch algorithms for…
permissive · top 5,000 on PyPI
fast-diff-match-patchWraps the C++ implementation of…
permissive · top 15,000 on PyPI
recursive-diffRecursively compares two Python data structures…
permissive · top 15,000 on PyPI
patchParses and applies unified diff patches to…
permissive · top 15,000 on PyPI
daffCompares two tables and produces a diff summary…
permissive · top 1,000 on PyPI
whatthepatchParses and applies patch files in multiple diff…
permissive · top 5,000 on PyPI
diff-parserParses git diff and .diff files to extract…
permissive · top 15,000 on PyPI
xmldiffxmldiff compares two XML files or trees and…
permissive · top 15,000 on PyPI