Coder Social home page Coder Social logo

Comments (4)

tggagne avatar tggagne commented on June 14, 2024 1

Thanks. That's what I needed.

from jycm.

eggachecat avatar eggachecat commented on June 14, 2024

@tggagne hi~you can get the detail with

print(ycm.to_dict())

from jycm.

eggachecat avatar eggachecat commented on June 14, 2024

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.

eggachecat avatar eggachecat commented on June 14, 2024

@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)

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.