Giter Site home page Giter Site logo

jsondiff's Introduction

jsondiff

Json diff using a python script in your bash.

Installation

The project written in python 3.8.10.

After cloning, run jsondiff.py.

Usage

» python jsondiff.py -h
usage: jsondiff [-h] [--nocolor] json_a json_b

Json diff using a python script in your bash.

positional arguments:
  json_a      First json to be compare.
  json_b      Second json to be compare.

optional arguments:
  -h, --help  show this help message and exit
  --nocolor   Turn colors off.

Examples

» cat dict_a.json
{
    "a": {
        "a": {
            "a": 1,
            "b": 1,
            "diff": 1
        },
        "b": {
            "a": 1
        },
        "c": {
            "a": 1
        }
    },
    "b": [
        1,
        2,
        3
    ]
}
» cat dict_b.json
{
    "a": {
        "a": {
            "a": 1,
            "c": 2,
            "diff": [
                1,
                2
            ]
        },
        "b": 3,
        "c": {
            "a": 2,
            "c": 1
        }
    },
    "b": [
        1,
        2,
        3
    ]
}
» python jsondiff.py dict_a.json dict_b.json
Got json_a = dict_a.json, json_b = dict_b.json

Keys inside of json_a (missing in json_b)
a::a::b = 1

Keys inside of json_b (missing in json_a)
a::a::c = 2
a::c::c = 1

Keys with diffrent values
@ a::a::diff
json a: 1
json a: 1

@ a::b
json a: {'a': 1}
json a: {'a': 1}

@ a::c::a
json a: 1
json a: 1

jsondiff's People

Contributors

aradzu10 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.