0

I have a JSON object in Python that represents operation data, and it's heavily nested. In constructing my UI for it, it looks like I'll need to show a section of it in a tree view.

Is there a way to find a key in a JSON object in Python? From the docs, it doesn't look like it. I could write something to traverse the object and find it, but if there's an out of the box way, that'd be preferable. Is there such a way?

Thank you for your time.

easythrees
  • 1,530
  • 3
  • 16
  • 43
  • 2
    Are you looking for a way to parse just a subset of the JSON data, or is the data already parsed (i.e. your question is about traversing a dictionary)? – Krumelur Feb 04 '13 at 01:36
  • It's already parsed, so I would say the latter. – easythrees Feb 04 '13 at 01:38
  • 2
    See [this question](http://stackoverflow.com/questions/380734/how-to-do-this-python-dictionary-traverse-and-search). I don't think there is a builtin function to do this, but you can probably create a one-liner for it if you put some effort into it. – Krumelur Feb 04 '13 at 01:41
  • Okay, thanks. I was wondering if there was something out of the box that would do it, but it seems I'll need to. Thanks again! – easythrees Feb 04 '13 at 01:53

0 Answers0