jsondiff
Diff JSON and JSON-like structures in Python
Decision gist · record as of 2026-08-14
Yes. The package is lightweight, actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a common problem cleanly. Install it if you need to understand or track changes in JSON or dict-like data structures; the low friction and stable API make it a safe dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- Low install friction; pure Python wheel with a single runtime dependency (pyyaml).
- Repository is active with a recent commit on 2026-06-28 and has been maintained since its first release in 2015.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with only attribution required; no restrictions on commercial or proprietary use.
last release 2024-08-29 (715 days) · last repo commit 2026-06-28 · 748 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 11,617,310 downloads/mo, #1,380 on PyPI
Alternatives
Verify before relying
pip install jsondiff
import jsondiff
result = jsondiff.diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4})
print(result) # {'c': 4, 'b': 3, delete: ['a']}- Whether the package handles deeply nested structures or very large JSON documents efficiently.
- Performance characteristics when diffing complex arrays with many reordered elements.
What it is and what it does
jsondiff computes a semantic diff between two JSON or JSON-like structures (dicts, lists, sets) and returns a compact representation of the changes. Instead of showing raw before-and-after values, it identifies specific insertions, deletions, and updates, making it easier to understand what changed between two versions of a data structure.
The package supports multiple diff syntaxes (compact, symmetric, explicit), can exclude specific paths from comparison, handles sets with special add/discard operations, and can load/dump JSON strings directly. It includes both a Python API and a command-line tool (jdiff) for comparing JSON and YAML files. The single runtime dependency is pyyaml, used for YAML support in the CLI.
Use it for
- Track configuration changes between versions by diffing JSON config files to see exactly what was added, removed, or modified.
- Generate minimal patches for API responses to transmit only the differences to clients rather than full payloads.
- Compare test fixtures or expected vs. actual output in test suites to identify specific assertion failures.
- Audit data migrations by diffing database exports or snapshots to verify what records changed.
- Build change logs or diffs for version control of JSON-based data (e.g., Terraform state, CloudFormation templates).
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is lightweight, actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a common problem cleanly. Install it if you need to understand or track changes in JSON or dict-like data structures; the low friction and stable API make it a safe dependency.
Install
jsondiff on PyPI
Before you install
Low install friction; pure Python wheel with a single runtime dependency (pyyaml). Repository is active with a recent commit on 2026-06-28 and has been maintained since its first release in 2015.
Requires Python 3.8 or later.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution required; no restrictions on commercial or proprietary use.
Quickstart
pip install jsondiff
import jsondiff
result = jsondiff.diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4})
print(result) # {'c': 4, 'b': 3, delete: ['a']}
Verify before relying
- Whether the package handles deeply nested structures or very large JSON documents efficiently.
- Performance characteristics when diffing complex arrays with many reordered elements.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepyyaml |
| Maintenance | Actively maintained 715 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,617,310 / month, #1,380 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 |
Evidence: jsondiff-2.2.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “json diff library”
- jsondiffComputes structured diffs between JSON and JSON-like Python objects,…
- json-diffCompares two JSON files and generates a JSON output showing the…
- json-merge-patchMerges JSON objects according to RFC 7386 and generates minimal…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also dictdiffer · dmiparser · json-delta · jsoncomparison · deepdiff · fast-diff-match-patch · fastdiff · condense-json · diff-match-patch · pyjson