Metadata-Version: 2.4
Name: minimindslab-json-deep-diff
Version: 0.1.0
Summary: Deterministically compare two JSON-compatible Python values or JSON strings recursively and report added, removed, and changed paths.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```bash
pip install minimindslab-json-deep-diff
```

## Usage

```python
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:

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