skillfed

dictdiffer

Dictdiffer is a library that helps you to diff and patch dictionaries.

dictdiffer v0.10.0 9.3M downloads/30d#1,549 on PyPI849
Permissive license MIT Active released

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 dictdiffer

uv

uv add dictdiffer

poetry

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 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Utilities

Tags

dictionary diff and patchcompare python dictsdict change detectiondictionary comparison libraryapply dict patchesfind dict differencesnested dictionary diff
data-comparisonstate-tracking

More Utilities packages