Skip to main content

Gives you a pretty good diff between two objects

Project description

Pretty Good Diff

This tool allows developers to compare two objects and see a highlight of the differences between them. It works with strings and dictionaries. This project was made to help me fix unit tests with failing assertions quicker, especially when the objects are huge or very nested and complicated. I simply call show_diff on the two objects before an assert statement.

show_diff

Import the show_diff method like from pretty_good_diff import show_diff.

Then, call show_diff(first_object, second_object) to see a colored diff of the input objects. first_object and second_object need to have the same type and be either str or dict objects.

Before: alt text

After: alt text

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

pretty-good-diff-0.1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

pretty_good_diff-0.1.0-py3-none-any.whl (8.8 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