dude
dude copied to clipboard
Selector for JSON contents
There are existing ways to extract data from JSON without traversing the contents one by one.
Options
Proposed style
@select(jsonpath="$.store.book[0].title")
def extract_title(title):
return {"title": title}
@select(jmespath="locations[?state == 'WA'].name | sort(@)")
def extract_washington_cities(cities):
return {"cities": cities}
Notes
- Only applies if content type is
application/json