pretty-good-diff


Namepretty-good-diff JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/Viktor-Bubanja/pretty-good-diff
SummaryGives you a pretty good diff between two objects
upload_time2023-10-06 16:16:49
maintainer
docs_urlNone
authorViktor Bubanja
requires_python>=3.9
license
keywords diff difference checker highlight color colour colored coloured
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/Viktor-Bubanja/pretty-good-diff/raw/main/blob/ugly_diff.png)

After:
![alt text](https://github.com/Viktor-Bubanja/pretty-good-diff/raw/main/blob/pretty_good_diff.png)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Viktor-Bubanja/pretty-good-diff",
    "name": "pretty-good-diff",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "diff,difference,checker,highlight,color,colour,colored,coloured",
    "author": "Viktor Bubanja",
    "author_email": "viktor.bubanja@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d8/e1/0c875652f9b824da40d55d97e0708c523dc77f4e2c56faee827d534f10c4/pretty-good-diff-0.1.0.tar.gz",
    "platform": null,
    "description": "# Pretty Good Diff\n\nThis tool allows developers to compare two objects and see a highlight of the differences between them. It works with strings and dictionaries.\nThis project was made to help me fix unit tests with failing assertions quicker, especially when the objects are huge or very nested and complicated.\nI simply call `show_diff` on the two objects before an assert statement.\n\n## show_diff\nImport the `show_diff` method like `from pretty_good_diff import show_diff`.\n\nThen, 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.\n\nBefore:\n![alt text](https://github.com/Viktor-Bubanja/pretty-good-diff/raw/main/blob/ugly_diff.png)\n\nAfter:\n![alt text](https://github.com/Viktor-Bubanja/pretty-good-diff/raw/main/blob/pretty_good_diff.png)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Gives you a pretty good diff between two objects",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Viktor-Bubanja/pretty-good-diff",
        "repository": "https://github.com/Viktor-Bubanja/pretty-good-diff"
    },
    "split_keywords": [
        "diff",
        "difference",
        "checker",
        "highlight",
        "color",
        "colour",
        "colored",
        "coloured"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "668b68d504332757034f428a06dd479c4951f3cabc8ba068fa150207facf9d57",
                "md5": "e6657989721f46c1666991ace3bded9f",
                "sha256": "92f29c90f06bd758abb01ccd3fe6ee72a2da3d002eafe026766e70d6097a9bce"
            },
            "downloads": -1,
            "filename": "pretty_good_diff-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6657989721f46c1666991ace3bded9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8752,
            "upload_time": "2023-10-06T16:16:45",
            "upload_time_iso_8601": "2023-10-06T16:16:45.842342Z",
            "url": "https://files.pythonhosted.org/packages/66/8b/68d504332757034f428a06dd479c4951f3cabc8ba068fa150207facf9d57/pretty_good_diff-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8e10c875652f9b824da40d55d97e0708c523dc77f4e2c56faee827d534f10c4",
                "md5": "c52a3c674c139fe8846404a2b5993245",
                "sha256": "e60b396b28b1348b3c243038b94f15d82e25777cc06a26ce5c6ba9d6abc3bc3b"
            },
            "downloads": -1,
            "filename": "pretty-good-diff-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c52a3c674c139fe8846404a2b5993245",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7276,
            "upload_time": "2023-10-06T16:16:49",
            "upload_time_iso_8601": "2023-10-06T16:16:49.091700Z",
            "url": "https://files.pythonhosted.org/packages/d8/e1/0c875652f9b824da40d55d97e0708c523dc77f4e2c56faee827d534f10c4/pretty-good-diff-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-06 16:16:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Viktor-Bubanja",
    "github_project": "pretty-good-diff",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pretty-good-diff"
}
        
Elapsed time: 0.12654s