A Python package to diff two dictionaries
Project description
pyDictDiff
Visit https://test.pypi.org/project/diffTool/
This is a dictionary diff package for python.
Installation
These instructions will get you a copy of the package up and running on your terminal for development and testing purposes.
To install, type:
pip install -i https://test.pypi.org/simple/ diffTool
Alternatively, to clone (with HTTPS):
git clone https://gitlab.com/anupamkrish/pydictdiff.git
or (with SSH):
git clone git@gitlab.com:anupamkrish/pydictdiff.git
Usage
Import the package
>>> from diffTool import Diff
Instantiate the class
>>> x = Diff(
{
"A": "B",
"C": {
"D": "E"
}
},
{
"A": "X",
"C": {
"D": "Y"
}
}
)
Access the differences through variable 'diffs'
>>> x.diffs
[
{
"A": {
"[-]": "B",
"[+]": "X"
}
},
{
"C -> D": {
"[-]": "E",
"[+]": "Y"
}
}
]
Caveat(s):
- Does not detect elements not present in 2nd dictionary.
Future work:
- Resolve caveat
- Support for arrays
- Strict option i.e. checks for order
- Return single dictionary
- Improved speed for large dictionaries
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydictdiff-1.0.0.tar.gz.
File metadata
- Download URL: pydictdiff-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8235639c2572d854db575cef380a7be7a0f3f680ecec41e892dafc3f141c8dc
|
|
| MD5 |
16faa63e967265cbc74c68e42911eb3e
|
|
| BLAKE2b-256 |
b5290e71f8e1c6a54735f2e46c81adf17a59a17cb468ee064347435ac8424c24
|
File details
Details for the file pydictdiff-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pydictdiff-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e578817736bd59eaaebaaa20269588905df58103b7bd661238f67b668bed95
|
|
| MD5 |
5f45c3d769884c42bc60a3b6aa80d5b6
|
|
| BLAKE2b-256 |
32054655851b8dd14d4aad22ea5d8d96a6fd1c4acc76a6d1ee922c5a617fc3cc
|