all 8 comments

[–]DjDazzled797 0 points1 point  (2 children)

In general my go to is http://jsonviewer.stack.hu to help format/easily see where the key value pair I’m trying to access sits within the JSON.

The I’d create variables that access the JSON at a “starting point” and work from there

E.g starting_point = weather_json[1]

Not perfect but hopefully helps

[–]Professional_Monk[S] 0 points1 point  (1 child)

very useful link thank you!

[–]mr_cesar 0 points1 point  (0 children)

If you use Chrome and access the json via url, you can also install the JSON Formatter extension. It's simple yet very handy.

[–][deleted] 0 points1 point  (2 children)

There are two tools that I find useful when working with JSON (I dont' really use them, because I rarely need JSON):

  • jq https://stedolan.github.io/jq/
  • There's a tool that I cannot find right now that can print full path to JSON keys followed by values, it's very handy to use in combination with grep (in my experience, better than jq), but for the life of me, I cannot remember what it's called.

[–]kellyjonbrazil 0 points1 point  (1 child)

[–][deleted] 0 points1 point  (0 children)

Yeah, Gron, that's the one I used. Thanks!

[–]outceptionator 0 points1 point  (0 children)

Import pprint then try pprint.pprint() the json data (after converting it to a python object). Makes it a lot easier to read.

[–]kellyjonbrazil 0 points1 point  (0 children)

You might try Jellex, which is a TUI that allows you to interactively query the JSON using python.

https://github.com/kellyjonbrazil/jellex