Metadata-Version: 2.5
Name: 222
Version: 0.0.2
Summary: Structural diff between two dicts, nested keys included.
Project-URL: Homepage, https://github.com/lqxnjk/222
Author: lqxnjk
License: MIT
License-File: LICENSE
Keywords: changes,compare,dict,diff,nested
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 222

Structural diff between two dictionaries — nested keys become dotted paths
instead of opaque subtree replacements.

The import name is `p222` because a Python module cannot start with a digit:

```python
from p222 import dict_diff
```

## Install

```console
pip install 222
```

## Usage

```python
from p222 import apply_diff, dict_diff

left = {"db": {"port": 5432, "host": "a"}, "tags": ["x"], "gone": 1}
right = {"db": {"port": 6543, "host": "a"}, "tags": ["y"], "new": 2}

diff = dict_diff(left, right)
# {
#   'db.port': ('changed', 5432, 6543),
#   'gone':    ('removed', 1, None),
#   'new':     ('added', None, 2),
#   'tags':    ('changed', ['x'], ['y']),
# }

apply_diff(left, diff) == right     # True
```

## Output shape

`{dotted.key: (kind, old_value, new_value)}` where `kind` is one of `added`,
`removed`, `changed`. Missing sides are reported as `None`.

## License

MIT
