Metadata-Version: 2.4
Name: philiprehberger-json-diff
Version: 0.1.1
Summary: Readable JSON comparison with colorized terminal output
Project-URL: Homepage, https://github.com/philiprehberger/py-json-diff#readme
Project-URL: Repository, https://github.com/philiprehberger/py-json-diff
Project-URL: Issues, https://github.com/philiprehberger/py-json-diff/issues
Project-URL: Changelog, https://github.com/philiprehberger/py-json-diff/blob/main/CHANGELOG.md
Author: Philip Rehberger
License-Expression: MIT
License-File: LICENSE
Keywords: colorized,compare,debugging,diff,json
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# philiprehberger-json-diff

Readable JSON/dict comparison with colorized terminal output.

## Installation

```bash
pip install philiprehberger-json-diff
```

## Usage

```python
from philiprehberger_json_diff import diff, format_diff, diff_summary

old = {"name": "Alice", "age": 30, "city": "NYC"}
new = {"name": "Alice", "age": 31, "country": "US"}

changes = diff(old, new)

# Pretty-print with colors
print(format_diff(changes))

# Get a summary
summary = diff_summary(changes)
# {"added": 1, "removed": 1, "modified": 1, "total": 3}
```

### Nested Comparison

```python
old = {"user": {"name": "Alice", "settings": {"theme": "dark"}}}
new = {"user": {"name": "Alice", "settings": {"theme": "light"}}}

changes = diff(old, new)
# Reports: modified user.settings.theme: 'dark' -> 'light'
```

### Ignore Paths

```python
changes = diff(old, new, ignore={"user.settings.theme"})
```

## API

- `diff(old, new, ignore=None)` — Compare two dicts, returns list of `Change` objects
- `format_diff(changes, color=True)` — Format changes as readable string with optional ANSI colors
- `diff_summary(changes)` — Return dict with counts by change type

## License

MIT
