KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any way / class / module in python to compare two json objects and print the changes/differences? I have tried with "json_tools" which is gives fairly good results, however diff failed in case if there are python lists' with elements in different orders in two json objects. e.g. JSON 1: { 'Person' : { 'FName' : 'John', 'LName' : 'Rambo', 'Sex' : 'Male' 'Height' : '6 ft', 'Weight' : '90 KG', 'Children' : [ { 'FName' : 'Anna', 'LName' : 'Rambo', 'Sex' : 'Female', 'Height' : '5 ft', 'Weight' : '55 KG', }, { 'FName' : 'Jemmy', 'LName' : 'Rambo', 'Sex' : 'Male', 'Height' : '5 ft', 'Weight' : '60 KG', } ] } } JSON 2: { 'Person' : { 'FName' : 'John', 'LName' : 'Rambo', 'Sex' : 'Male' 'Height' : '6 ft', 'Weight' : '90 KG', 'Children' : [ { 'FName' : 'Jemmy', 'LName' : 'Rambo', 'Sex' : 'Male', 'Height' : '5 ft', 'Weight' : '60 KG', }, { 'FName' : 'Anna', 'LName' : 'Rambo', 'Sex' : 'Female', 'Height' : '5 ft', 'Weight' : '55 KG', } ] } } json dif
Tags (comma-separated)
Save Edits
Cancel