Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
jq: sed for json (stedolan.github.com)
59 points by 6ren on Dec 30, 2012 | hide | past | favorite | 10 comments


I like those tools - working with json files often calls for some simple processing and it's a bit silly to write an app for each case. But I wish they would start embracing some common standard. So far we've got:

* jsonselect

* jsonpath

* jsonquery

* jaql

* unql (query part)

which all need the same query dsl, but use a slightly different syntax. I'd really like to see them unified one day, like xpath is the default for xml.


Exactly. See also similar ideas for yaml:

https://github.com/peterkmurphy/YPath-Specification

https://github.com/briandfoy/ypath

Traversing and extracting data from a hierarchical structure is a basic task that shouldn't need to be reinvented every time.



I would like something like this but for querying Python objects (dict containing lists of dicts with particular key-values that are needed, etc.) sort of like a declarative way of cleanly creating a new data structure from a response, or even yielding elements that match the definition I give. Does anything like this exist already? I am constantly writing different code to do this.


Wouldn't that be python?


It would be some kind of meta-language that expressed these concepts of shuffling data around in a more succinct, non-imperative form. But having said that, I'm not really sure whether this could be done in Python.


awk for json would be really nice (where patterns and records match substructures ...)


jgrep?


this reminds me a bit of powershell's XML/object filtering except less painful.


great work! btw, is there a versioned json toolkit?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: