Skip to main content

MiniMindsLab JSON Deep Diff

Deterministically compare two JSON-compatible Python values (or JSON strings) recursively and report path-based differences.

Features

  • Pure Python, standard library only
  • Deterministic output ordering
  • Supports nested dict and list structures
  • Distinguishes JSON booleans from numbers (true is not 1)
  • Clear ValueError on invalid JSON input text

Installation

pip install minimindslab-json-deep-diff

Usage

from minimindslab_json_deep_diff import deep_diff

left = {
    "name": "demo",
    "flags": [True, False],
    "meta": {"version": 1}
}
right = {
    "name": "demo2",
    "flags": [True],
    "meta": {"version": 1, "new": "x"}
}

result = deep_diff(left, right)
print(result)
# {
#   'added': [{'path': '$.meta.new', 'value': 'x'}],
#   'removed': [{'path': '$.flags[1]', 'value': False}],
#   'changed': [
#       {'path': '$.name', 'from': 'demo', 'to': 'demo2'}
#   ]
# }

You can also pass JSON text:

result = deep_diff('{"a":1}', '{"a":2}')

API

  • deep_diff(left, right) -> dict
  • parse_json_value(value) -> Any

Return structure:

  • added: list of {path, value}
  • removed: list of {path, value}
  • changed: list of {path, from, to}

Paths use a JSONPath-like format rooted at $, with object keys via .key and list indices via [index].

License

MIT

Metadata

Release files for minimindslab-json-deep-diff 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minimindslab-json-deep-diff 0.1.0
File Size Uploaded Provenance
minimindslab_json_deep_diff-0.1.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for minimindslab-json-deep-diff 0.1.0
File Interpreter ABI Platform
minimindslab_json_deep_diff-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / minimindslab_json_deep_diff-0.1.0.tar.gz

Download URL minimindslab_json_deep_diff-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6d2d52bb799b57abb46e990045c3af0e9685081350c185865c93f4e7191b60ea
BLAKE2b-256 checksum
How to use checksums
ef94067766cbb3c53bd2aaddb9d03ee90bfa5d1c7f9cc0f1d2fcdf0da4439f92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

Release files / minimindslab_json_deep_diff-0.1.0-py3-none-any.whl

Download URL minimindslab_json_deep_diff-0.1.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77096966747ad9db17bcd4cdc450018b19aa72fbafa66888fdb88fc39ac105ca
BLAKE2b-256 checksum
How to use checksums
0630854f46fa5d2c127f4acc189b6a5f4233ae36548f1f21233255afed7b2ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

Security for minimindslab-json-deep-diff 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page