xlwings / Jsondiff
Licence: mit
Diff JSON and JSON-like structures in Python
Stars: ✭ 404
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Jsondiff
Sirix
SirixDB is a temporal, evolutionary database system, which uses an accumulate only approach. It keeps the full history of each resource. Every commit stores a space-efficient snapshot through structural sharing. It is log-structured and never overwrites data. SirixDB uses a novel page-level versioning approach called sliding snapshot.
Stars: ✭ 638 (+57.92%)
Mutual labels: json, diff
Api Diff
A command line tool for diffing json rest APIs
Stars: ✭ 164 (-59.41%)
Mutual labels: json, diff
Dyff
/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
Stars: ✭ 277 (-31.44%)
Mutual labels: json, diff
Zson
ZSON is a PostgreSQL extension for transparent JSONB compression
Stars: ✭ 385 (-4.7%)
Mutual labels: json
Jsoncons
A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
Stars: ✭ 400 (-0.99%)
Mutual labels: json
Tomlplusplus
Header-only TOML config file parser and serializer for C++17 (and later!).
Stars: ✭ 403 (-0.25%)
Mutual labels: json
jsondiff
Diff JSON and JSON-like structures in Python.
Installation
pip install jsondiff
Quickstart
.. code-block:: python
>>> from jsondiff import diff
>>> diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4})
{'c': 4, 'b': 3, delete: ['a']}
>>> diff(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])
{insert: [(3, 'd')]}
>>> diff(['a', 'b', 'c'], ['a', 'c'])
{delete: [1]}
# Typical diff looks like what you'd expect...
>>> diff({'a': [0, {'b': 4}, 1]}, {'a': [0, {'b': 5}, 1]})
{'a': {1: {'b': 5}}}
# ...but similarity is taken into account
>>> diff({'a': [0, {'b': 4}, 1]}, {'a': [0, {'c': 5}, 1]})
{'a': {insert: [(1, {'c': 5})], delete: [1]}}
# Support for various diff syntaxes
>>> diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, syntax='explicit')
{insert: {'c': 4}, update: {'b': 3}, delete: ['a']}
>>> diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, syntax='symmetric')
{insert: {'c': 4}, 'b': [2, 3], delete: {'a': 1}}
# Special handling of sets
>>> diff({'a', 'b', 'c'}, {'a', 'c', 'd'})
{discard: set(['b']), add: set(['d'])}
# Load and dump JSON
>>> print diff('["a", "b", "c"]', '["a", "c", "d"]', load=True, dump=True)
{"$delete": [1], "$insert": [[2, "d"]]}
Command Line Client
Usage::
jsondiff [-h] [-p] [-s SYNTAX] [-i INDENT] first second
positional arguments:
first
second
optional arguments:
-h, --help show this help message and exit
-p, --patch
-s SYNTAX, --syntax SYNTAX
-i INDENT, --indent INDENT
Examples:
.. code-block:: bash
$ jsondiff a.json b.json -i 2
$ jsondiff a.json b.json -i 2 -s symmetric
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].