jdif


Namejdif JSON
Version 4.6.2 PyPI version JSON
download
home_pageNone
SummaryTo find json differences on CLI
upload_time2024-08-27 13:31:29
maintainerNone
docs_urlNone
authorshivani
requires_python>=3.10
licenseMIT
keywords json diff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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 jdif``

## 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": "jdif",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "json, diff",
    "author": "shivani",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b2/24/4b5e2893cd03c66d2df812b070a3ac9865e505d9ff8d290fb77d51ee8ade/jdif-4.6.2.tar.gz",
    "platform": null,
    "description": "## 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 jdif``\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 find json differences on CLI",
    "version": "4.6.2",
    "project_urls": {
        "Source": "https://github.com/Shivani-20/json-diff-cli"
    },
    "split_keywords": [
        "json",
        " diff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5c656f3b539dfc9594581a614f6f1d55fa3efc061cee1ac890e0967cedc1bbe",
                "md5": "c69eee411d36a070a0d6777d5e609515",
                "sha256": "8b1ed751b2985018ee2fec53fe15c2335d0e5abe836bc556968db35cc007d538"
            },
            "downloads": -1,
            "filename": "jdif-4.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c69eee411d36a070a0d6777d5e609515",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6162,
            "upload_time": "2024-08-27T13:31:28",
            "upload_time_iso_8601": "2024-08-27T13:31:28.353512Z",
            "url": "https://files.pythonhosted.org/packages/c5/c6/56f3b539dfc9594581a614f6f1d55fa3efc061cee1ac890e0967cedc1bbe/jdif-4.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2244b5e2893cd03c66d2df812b070a3ac9865e505d9ff8d290fb77d51ee8ade",
                "md5": "a7e857de92a09c2ebe11b103296b076e",
                "sha256": "8027f0c4bddd6736f5f5d3263faef86e01e20c3262360ad141c05d5e8bbcd38f"
            },
            "downloads": -1,
            "filename": "jdif-4.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a7e857de92a09c2ebe11b103296b076e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5672,
            "upload_time": "2024-08-27T13:31:29",
            "upload_time_iso_8601": "2024-08-27T13:31:29.529711Z",
            "url": "https://files.pythonhosted.org/packages/b2/24/4b5e2893cd03c66d2df812b070a3ac9865e505d9ff8d290fb77d51ee8ade/jdif-4.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 13:31:29",
    "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": "jdif"
}
        
Elapsed time: 0.28057s