skillfed

jsoncomparison

json compare utility

jsoncomparison v1.1.0 1.0M downloads/30d#4,499 on PyPI68
Permissive license MIT DORMANT released

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 jsoncomparison

uv

uv add jsoncomparison

poetry

poetry add jsoncomparison

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Testing

Tags

json comparisoncompare nested objectsjson difftest data validationdetect json differencesobject equality checkjson assertion
testingjson-diffdata-validation

More Libraries packages