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:
from p222 import dict_diff
Install
pip install 222
Usage
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
Metadata
Release files for 222 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| 222-0.0.2.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 222-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / 222-0.0.2.tar.gz
| Download URL | 222-0.0.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bc144d7382030a7c1c112d786e1f1d96e8abe78fe49c15aa02b04d104e9506d
|
|
BLAKE2b-256 checksum How to use checksums |
45e63808c2192ab0c3f746906d334df113d434c991efbb53acd630402537267e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / 222-0.0.2-py3-none-any.whl
| Download URL | 222-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dc3359587a20d4261d692e6f61841e8efd0a402c304ce8637a659bd84d64d14
|
|
BLAKE2b-256 checksum How to use checksums |
4d610a7d1da12fd9a7bf78c66abd8ef1bc5e64f67b258df8166cc8313722de79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for 222 0.0.2
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.