jsoncomparison
json compare utility
What it is and what it does
jsoncomparison is a utility for comparing two JSON-like objects (dictionaries, lists, nested structures) and reporting all differences in a structured format. It identifies type mismatches, value changes, missing or extra keys, and array length/content variations, returning a nested dictionary that mirrors the structure of the input and marks each discrepancy with metadata (_message, _expected, _received). The package is commonly used in test assertions to validate that actual API responses or data structures match expected outputs.
The library offers configuration options to customize comparison behavior—such as rounding tolerances for floats and array length checking—and supports ignore rules to exclude specific keys or values from comparison. With zero runtime dependencies and a pure-Python wheel distribution, it installs quickly and runs without external system requirements.
Use it for:
- Validate API responses in integration tests by comparing expected JSON structure to actual server output.
- Detect configuration file changes by comparing old and new JSON/dict representations and reporting all differences.
- Assert test data correctness in unit tests where nested object equality needs detailed diff output.
- Debug data transformation pipelines by comparing input and output JSON structures to identify where values diverge.
- Generate human-readable diff reports for JSON documents in CI/CD pipelines to track what changed between versions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compares two JSON-like objects and returns a detailed dictionary of differences, including type mismatches, value changes, missing keys, and array length variations.
Yes, if you need JSON/dict comparison in tests or data validation and can tolerate dormant maintenance. The package is stable, dependency-free, and widely used (1M+ monthly downloads). However, do not install if you require active bug fixes, Python 3.10+ support guarantees, or ongoing feature development—the last release was in 2021 and no updates are planned.
Install
jsoncomparison on PyPI
pip
pip install jsoncomparisonuv
uv add jsoncomparisonpoetry
poetry add jsoncomparisonInstalling jsoncomparison
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2021-05-17, over 1915 days ago—so expect no active bug fixes or updates, though the package remains archived=false and the repo is still accessible.
License in practice
MIT license is permissive and imposes minimal restrictions; you can use this package freely in commercial and private projects with only attribution required.
Quickstart
pip install jsoncomparison
from jsoncomparison import Compare, NO_DIFF
expected = {"key": "value"}
actual = {"key": "other"}
diff = Compare().check(expected, actual)
if diff != NO_DIFF:
print(diff)
Requires Python >=3.6.1,<4.0.0; no external runtime dependencies.
Verify before relying
- Whether the package handles circular references or deeply nested structures without performance degradation.
- Current compatibility with Python 3.10+ given the last release predates those versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6.1,<4.0.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,915 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,017,473/month — #4,499 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsoncomparison-1.1.0-py3-none-any.whl
Keywords: json, compare
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
condense-jsonCondense JSON by replacing repeated strings and…
permissive · top 15,000 on PyPI
jsondiffComputes structured diffs between JSON and…
permissive · top 5,000 on PyPI
pyjsonCompares the similarity between two JSON files…
permissive · top 15,000 on PyPI
recursive-diffRecursively compares two Python data structures…
permissive · top 15,000 on PyPI
json-diffCompares two JSON files and generates a JSON…
permissive · top 15,000 on PyPI
dirty-equalsProvides custom equality matchers that make…
permissive · top 5,000 on PyPI
dictdifferDictdiffer computes and applies diffs and…
permissive · top 5,000 on PyPI
deepdiff6DeepDiff recursively compares two Python…
permissive · top 15,000 on PyPI
coolacoola compares complex nested data structures…
permissive · top 5,000 on PyPI
version-utilsParses and compares package version strings in…
copyleft · top 15,000 on PyPI