views:

80

answers:

1

In Python 3 it is easy to find a given tag in an XML file via etree.

Using JSON, I've found there isn't a function to do that. Is there a library that does so efficiently? Is it worth my time to have a tree constructed from some JSON?

I'm having to use woeid = data["places"]["place"][0]["woeid"] where with XML I could simply use tree.findall("\\woeid"), though I'm assuming there's a significant overhead for the latter.

+1  A: 

Check out jsonpath.

Hank Gay