Metadata-Version: 2.4
Name: jsonpatcher
Version: 0.2.0
Summary: Deep merge + diff/patch + apply patch for nested dict/list JSON-like structures.
Author: Guillaume ONEill
License: python -m venv .venv
        source .venv/bin/activate   # windows: .venv\Scripts\activate
        pip install -U pip build hatchling
        python -m build
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# jsonpatcher

Utility for JSON-like nested dict/list structures:

- Deep merge with strategies (override/keep/append/set_union/merge_by_id)
- Diff: produce a patch from A -> B
- Apply patch: replay patch operations (set/del/ins)

## Install
pip install jsonpatcher

## Deep merge

```python
from jsonpatcher import deep_merge, MergeOptions

base = {"a": {"b": [{"id":1,"c":1},{"id":2,"c":2}]}, "x": 9}
override = {"a": {"b": [{"id":2,"c":222},{"id":3,"c":3}]}, "x": None}

out = deep_merge(base, override, options=MergeOptions(strategy="merge_by_id", delete_none=True))
print(out)
# {"a":{"b":[{"id":1,"c":1},{"id":2,"c":222},{"id":3,"c":3}]}}