a tool to diff dict list set data
Project description
a tool to diff dict list set data output like the npm package deep_diff
USAGE
pip install deep_diff
from deep_diff import diff
diff({'a':1},{'b':1})
[ { kind: 'E',
path: [ 'name' ],
lhs: 'my object',
rhs: 'updated object' },
{ kind: 'E',
path: [ 'details', 'with', 2 ],
lhs: 'elements',
rhs: 'more' },
{ kind: 'A',
path: [ 'details', 'with' ],
index: 3,
item: { kind: 'N', rhs: 'elements' } },
{ kind: 'A',
path: [ 'details', 'with' ],
index: 4,
item: { kind: 'N', rhs: { than: 'before' } } } ]
Differences
Differences are reported as one or more change records. Change records have the following structure:
kind
- indicates the kind of change; will be one of the following:N
- indicates a newly added property/elementD
- indicates a property/element was deletedE
- indicates a property/element was editedA
- indicates a change occurred within an array
path
- the property path (from the left-hand-side root)lhs
- the value on the left-hand-side of the comparison (undefined if kind == 'N')rhs
- the value on the right-hand-side of the comparison (undefined if kind == 'D')index
- when kind == 'A', indicates the array index where the change occurreditem
- when kind == 'A', contains a nested change record indicating the change that occurred at the array index
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deep_diff-0.0.4.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file deep_diff-0.0.4.tar.gz
.
File metadata
- Download URL: deep_diff-0.0.4.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a26e2e12e47309eb882a560241c88aa3634223239462f9b8a3c8ee7fb0350cab
|
|
MD5 |
99e543e1c68f24e605c1b9d072546249
|
|
BLAKE2b-256 |
9a60365c232a3a77187f48c42915f0aae7afa90d37dd284377b2c573e1a628ff
|
File details
Details for the file deep_diff-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: deep_diff-0.0.4-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6c7a3d5dfffa6633de09d28da42c8c6056d2367d70491389a2d6f8016a58c8ef
|
|
MD5 |
adf346ff6d4c37e647a668970a59285d
|
|
BLAKE2b-256 |
42bb975a0c0c1164988dbb45fb16b7c8697a716c998e7c4958326fb1001a769a
|