2 ms·
JMESPath is the only viable alternative, which probably has a wider footprint than even jq as it's part of AWS CLI.
by nikolay 6y ago
JMESPath is the only viable alternative, which probably has a wider footprint than even jq as it's part of AWS CLI.
- acdha 6y agoIt's definitely popular but “only viable alternative” is a bit strong: that's only if you need compatibility with particular tools which support only one of the two formats. There's no reason why anyone who doesn't like those tools couldn't create a different syntax to scratch whatever particular itch they have.
- nikolay 6y agoIt's embeddable and available as a library for all languages [0]. Everything else is nothing but an CLI tool pretty much, which further limits its adoption. [0]: https://github.com/jmespath https://github.com/jmespath
- acdha 6y agoWell, there is XPath 3.1 if you want standards[1] but my point was simply that it depends on whether your question is “I need compatibility with existing jq scripts”, “I need an embeddable library I can integrate in other programs”, or “I want to process JSON for my own usage”. For example, someone who works with a lot of Python might prefer something like https://github.com/kellyjonbrazil/jello https://github.com/kellyjonbrazil/jello to write comprehensions using the full capabilities of Python, especially since that would provide a direct path to using the final expressions in a Python program or even embedded in one of the environments where Python is used as a scripting language. Is that a viable alternative? The answer depends entirely on who's asking. 1. https://www.w3.org/TR/xpath-31/#id-introduction https://www.w3.org/TR/xpath-31/#id-introduction