Skip to main content

A Python package to diff two dictionaries

Project description

pyDictDiff

Visit https://pypi.org/project/pydictdiff/

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 pydictdiff

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.result
{
  "A": {
    "[-]": "B",
    "[+]": "X"
  },
  "C": {
    "D": {
      "[-]": "E",
      "[+]": "Y"
    }
  }
}

Future work:

  • Support for arrays

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydictdiff-1.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydictdiff-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pydictdiff-1.0.1.tar.gz.

File metadata

  • Download URL: pydictdiff-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pydictdiff-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6710abafb4e3486c9216f1b1e841b3e650c7af76fc39473958d909d1555f75ec
MD5 f41ca2af7beec216b9617be34cf86dab
BLAKE2b-256 83eee14328ac98920114b8279f66c496de1558e794abe757ede536320c3d63fd

See more details on using hashes here.

File details

Details for the file pydictdiff-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pydictdiff-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pydictdiff-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23f5d5defca5855f3481316cfb1529e81ef63eebe16afa9f72a1407ccdaee7c2
MD5 031ebd7c837b6576fae2d13a915fe117
BLAKE2b-256 b5f32bba150ca9dd181bd9656cba9f01b70beaeaa70d06cee2fbe5c328244811

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page