Skip to main content

Pretty JSON data diffs

Project description

prettydiff

prettydiff - diff parsed JSON objects and pretty-print it

$ python3 -m pip install prettydiff

terminal

from prettydiff import print_diff

a = {"a": "hello", "b": True, "c": [1, 3], "d": {"e": {"f": 1}}}
b = {"a": "world", "b": False, "c": [1, 2, 3]}

# to enable colors: $ python3 -m pip install prettydiff[terminal]
print_diff(a, b)
  {
-   'a': 'hello',
+   'a': 'world',
-   'b': True,
+   'b': False,
    'c': [
      1,
-     3,
+     2,
+     3,
    ],
-   'd': {
-     'e': {
-       'f': 1,
-     },
-   },
  }

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

prettydiff-0.1.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

prettydiff-0.1.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

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