json-diff-cli


Namejson-diff-cli JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryTo display json differences on CLI
upload_time2024-08-27 21:50:22
maintainerNone
docs_urlNone
authorshivani
requires_python>=3.8
licenseMIT
keywords json diff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Generates differences between two json files on the console in a colored and columnar manner.

## Motivation

To find difference between two long json files on the cli itself, instead of downloading files and copy pasting on some website to find the difference. Helpful when comparing production env data with the admin dashboard data during the debugging process.

## Installation

``pip install json-diff-cli``

## Quickstart

* if a key appears in first file but not in second file OR the key appears in second file but not in first file,
color of the key changes to red

* if a value of a specific key is different in both the files, 
color of that key-value pair changes to green:

Combination of above 2 example

[![Example](https://raw.githubusercontent.com/Shivani-20/json-diff-cli/main/visuals/jdif_cli.png)]

## Caveats

```python

>>> jdif
usage: jdif [-h] jsonFilePath1 jsonFilePath2
jdif: error: the following arguments are required: jsonFilePath1, jsonFilePath2
Arguments absent: please specify file paths as shown in the example below:
jdif example_1.json example_2.json

>>> jdif /../ /.../
Unable to read file in '\..', please verify the path and filename alongwith the extension

>>> jdif a1.json b1.json 
Invalid json in 'b1.json'

>>> jdif a1.json b1.json
Empty json in 'b1.json'

>>> jdif a1.json b1.json
JSON is same in both the files
```
**order** of the keys might change within an object because we are first processing values then modified keys:

suppose if j1.json has:
```json
{
    "key1": true,
    "key3": "abcd"
}
```
j2.json:
```json
{
    "key4": false,
    "key3": ""
}
```
``` python
>>> jdif j1.json j2.json
```

[![Example](https://raw.githubusercontent.com/Shivani-20/json-diff-cli/main/visuals/order.png)]


## Features

* Takes care of unicode, windows1252 characters, so the strings could be in any language or represent a symbol
* Takes care of long descriptive values or keys
* Takes care of empty valued strings
* Instead of dumping into some other file, it displays the differences on the console itself 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "json-diff-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "json, diff",
    "author": "shivani",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/84/f4/244cbb5da2c70063b291712b2bbe17047f4354d4c834bf391b1b31b7a836/json_diff_cli-1.0.2.tar.gz",
    "platform": null,
    "description": "Generates differences between two json files on the console in a colored and columnar manner.\r\n\r\n## Motivation\r\n\r\nTo find difference between two long json files on the cli itself, instead of downloading files and copy pasting on some website to find the difference. Helpful when comparing production env data with the admin dashboard data during the debugging process.\r\n\r\n## Installation\r\n\r\n``pip install json-diff-cli``\r\n\r\n## Quickstart\r\n\r\n* if a key appears in first file but not in second file OR the key appears in second file but not in first file,\r\ncolor of the key changes to red\r\n\r\n* if a value of a specific key is different in both the files, \r\ncolor of that key-value pair changes to green:\r\n\r\nCombination of above 2 example\r\n\r\n[![Example](https://raw.githubusercontent.com/Shivani-20/json-diff-cli/main/visuals/jdif_cli.png)]\r\n\r\n## Caveats\r\n\r\n```python\r\n\r\n>>> jdif\r\nusage: jdif [-h] jsonFilePath1 jsonFilePath2\r\njdif: error: the following arguments are required: jsonFilePath1, jsonFilePath2\r\nArguments absent: please specify file paths as shown in the example below:\r\njdif example_1.json example_2.json\r\n\r\n>>> jdif /../ /.../\r\nUnable to read file in '\\..', please verify the path and filename alongwith the extension\r\n\r\n>>> jdif a1.json b1.json \r\nInvalid json in 'b1.json'\r\n\r\n>>> jdif a1.json b1.json\r\nEmpty json in 'b1.json'\r\n\r\n>>> jdif a1.json b1.json\r\nJSON is same in both the files\r\n```\r\n**order** of the keys might change within an object because we are first processing values then modified keys:\r\n\r\nsuppose if j1.json has:\r\n```json\r\n{\r\n    \"key1\": true,\r\n    \"key3\": \"abcd\"\r\n}\r\n```\r\nj2.json:\r\n```json\r\n{\r\n    \"key4\": false,\r\n    \"key3\": \"\"\r\n}\r\n```\r\n``` python\r\n>>> jdif j1.json j2.json\r\n```\r\n\r\n[![Example](https://raw.githubusercontent.com/Shivani-20/json-diff-cli/main/visuals/order.png)]\r\n\r\n\r\n## Features\r\n\r\n* Takes care of unicode, windows1252 characters, so the strings could be in any language or represent a symbol\r\n* Takes care of long descriptive values or keys\r\n* Takes care of empty valued strings\r\n* Instead of dumping into some other file, it displays the differences on the console itself \r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "To display json differences on CLI",
    "version": "1.0.2",
    "project_urls": {
        "Source": "https://github.com/Shivani-20/json-diff-cli"
    },
    "split_keywords": [
        "json",
        " diff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a19affdf9737bf7d064d0984c043a57d3c067a5640e1d8a44a483ad607764b31",
                "md5": "c8e56a154fa8870fd1fb178e4c22c178",
                "sha256": "222dc30a64d518bcc102a081701a73449dcf3b4a9080aac146e00dafd007714d"
            },
            "downloads": -1,
            "filename": "json_diff_cli-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c8e56a154fa8870fd1fb178e4c22c178",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6303,
            "upload_time": "2024-08-27T21:50:21",
            "upload_time_iso_8601": "2024-08-27T21:50:21.349393Z",
            "url": "https://files.pythonhosted.org/packages/a1/9a/ffdf9737bf7d064d0984c043a57d3c067a5640e1d8a44a483ad607764b31/json_diff_cli-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84f4244cbb5da2c70063b291712b2bbe17047f4354d4c834bf391b1b31b7a836",
                "md5": "578a95ae92fcad46b373977e51cea760",
                "sha256": "23cb8c81b4ce8115f36131ebbb56e1f1a8f0cdf11da3230cf394f812a5d79f84"
            },
            "downloads": -1,
            "filename": "json_diff_cli-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "578a95ae92fcad46b373977e51cea760",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5708,
            "upload_time": "2024-08-27T21:50:22",
            "upload_time_iso_8601": "2024-08-27T21:50:22.713908Z",
            "url": "https://files.pythonhosted.org/packages/84/f4/244cbb5da2c70063b291712b2bbe17047f4354d4c834bf391b1b31b7a836/json_diff_cli-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 21:50:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Shivani-20",
    "github_project": "json-diff-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "json-diff-cli"
}
        
Elapsed time: 0.28232s