Comments (4)
Thanks. That's what I needed.
from jycm.
@tggagne hi~you can get the detail with
print(ycm.to_dict())
from jycm.
BTW here's the full code for your example (left and right object should be object not string)
from jycm.helper import make_ignore_order_func
from jycm.jycm import YouchamaJsonDiffer
left = { "one" : 1, "two" : 2 }
right = { "one" : 1, "two" : 2 }
ycm = YouchamaJsonDiffer(left, right)
ycm.diff() # you have to call this method before you call to_dict
print(ycm.to_dict(no_pairs=True))
left = { "one" : 1, "two" : 2 }
right = { "one" : 2, "two" : 1 }
ycm = YouchamaJsonDiffer(left, right)
ycm.diff()# you have to call this method before you call to_dict
print(ycm.to_dict(no_pairs=True))
below is the output
{}
{'value_changes': [
{'left': 1, 'right': 2, 'left_path': 'one', 'right_path': 'one', 'old': 1, 'new': 2},
{'left': 2, 'right': 1, 'left_path': 'two', 'right_path': 'two', 'old': 2, 'new': 1}]}
from jycm.
@tggagne Hi! Just for your reference
Now jycm supports result-visualization
- upgrade jycm
pip install jycm --upgrade
- then you can visualize the results by
python -m jycm --show \
--left="{ \"one\" : 1, \"two\" : 2 }" \
--right="{ \"one\" : 2, \"two\" : 1 }"
more example can be viewed an the updated README~
from jycm.
Related Issues (12)
- include the rendering tool HOT 5
- Can the original names of the left and right files be displayed in the browser instead of left and right HOT 2
- Lowercase true and false, and null values in JSON throw a NameError HOT 2
- Dependencies are resolved too slow when adding jycm to a poetry project HOT 2
- Command line arguments limit HOT 3
- The code examples do not open up the graph/diff view for me HOT 4
- Error trying to diff very large objects HOT 1
- Update docs to include what nopairs is for. HOT 1
- to_dict returning {} when there is diff, but diff() has not been called. HOT 1
- Applying a diff to a json HOT 1
- Windows can't find jycm_viewer_assets HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jycm.