TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

FX: An interactive alternative to jq to process JSON

257 点作者 federicoterzi超过 3 年前

18 条评论

visarga超过 3 年前
JQ syntax feels too unusual, doesn&#x27;t resemble known code, gives me the feeling of looking into cryptic Perl or regex, could never remember the simplest things.<p>For example how would you take key k1 from a list of dicts [{k1: v1, k2: v2}, {k1: v3}]?
评论 #29862490 未加载
评论 #29861859 未加载
评论 #29862499 未加载
评论 #29861912 未加载
评论 #29862459 未加载
评论 #29862487 未加载
评论 #29861858 未加载
评论 #29868057 未加载
JimDabell超过 3 年前
There’s also jp, which interprets JMESPath: <a href="https:&#x2F;&#x2F;github.com&#x2F;jmespath&#x2F;jp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jmespath&#x2F;jp</a><p>This one has the advantage of being natively understood by aws-cli, meaning you can pass a JMESPath to an AWS call and only receive the filtered &#x2F; transformed result back.
kbrazil超过 3 年前
For those who are comfortable with python, I created Jello[0], which works like jq but uses python syntax.<p>I also created Jellex[1], which is a TUI built on Jello to assist with building the python queries.<p>Jello gives you the power of python but without all of the boilerplate, so it’s nicer to use in Bash scripts.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;kellyjonbrazil&#x2F;jello" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kellyjonbrazil&#x2F;jello</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;kellyjonbrazil&#x2F;jellex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kellyjonbrazil&#x2F;jellex</a>
ducaale超过 3 年前
Apparently, the author wrote this tool because jid was struggling with a 7MB JSON file.<p>See <a href="https:&#x2F;&#x2F;github.com&#x2F;simeji&#x2F;jid&#x2F;issues&#x2F;66#issuecomment-443671843" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;simeji&#x2F;jid&#x2F;issues&#x2F;66#issuecomment-4436718...</a>
评论 #29861688 未加载
评论 #29861957 未加载
okasaki超过 3 年前
If you want to use jq but with Python syntax, I wrote pq:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dvolk&#x2F;pq" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dvolk&#x2F;pq</a>
评论 #29861879 未加载
tyingq超过 3 年前
That&#x27;s pretty cool. Would be nice if there was an option to put the currently used filter&#x2F;query into the shell history or the clipboard. So that you could experiment to find the right one, then back out and use it in a pipeline.
评论 #29863586 未加载
lr1970超过 3 年前
gron [0] is another interesting JSON processor that follows UNIX philosophy:<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;tomnomnom&#x2F;gron" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tomnomnom&#x2F;gron</a><p>&quot;Make JSON greppable!&quot;<p>&quot;gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute &#x27;path&#x27; to it.&quot;
评论 #29862549 未加载
xconverge超过 3 年前
I also like <a href="https:&#x2F;&#x2F;github.com&#x2F;dflemstr&#x2F;rq" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dflemstr&#x2F;rq</a> because it supports a few more formats (protobufs for example)
eatonphil超过 3 年前
If you&#x27;re into the SQL side (compared to jq&#x27;s custom query language) of querying arbitrary files I&#x27;ve got a comparison of some major tools here too.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;multiprocessio&#x2F;datastation&#x2F;tree&#x2F;main&#x2F;runner&#x2F;cmd&#x2F;dsq#comparisons" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;multiprocessio&#x2F;datastation&#x2F;tree&#x2F;main&#x2F;runn...</a>
fiestajetsam超过 3 年前
It would be a good idea if this was added to one of the existing[1] comparison tools for similar tools, there&#x27;s already a lot of them out there.<p>1: <a href="https:&#x2F;&#x2F;cburgmer.github.io&#x2F;json-path-comparison&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cburgmer.github.io&#x2F;json-path-comparison&#x2F;</a>
peterohler超过 3 年前
Another alternative is the oj app (ojg&#x2F;cmd&#x2F;oj) which is part of <a href="https:&#x2F;&#x2F;github.com&#x2F;ohler55&#x2F;ojg" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ohler55&#x2F;ojg</a>. It relies on JSONPath for extraction and manipulation of JSON.
meepmorp超过 3 年前
Since nobody else mentioned it, there&#x27;s also jiq, which uses jq under the hood.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;fiatjaf&#x2F;jiq" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fiatjaf&#x2F;jiq</a>
ananthakumaran超过 3 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;akavel&#x2F;up" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;akavel&#x2F;up</a> is another tool that can be used to make most of commands interactive
_kk_331超过 3 年前
Would be really nice if there was a big warning somewhere in the installation section that it doesn&#x27;t work on windows (outside wsl).
darkstarsys超过 3 年前
Looks really nice. I wish it handled yaml as well.
评论 #29867070 未加载
jbverschoor超过 3 年前
This simply evals the argument. Not an alternative to jq.<p><pre><code> fx “code to eval”</code></pre>
评论 #29865661 未加载
评论 #29861930 未加载
greatgib超过 3 年前
Would be cool if it was not a cli made in &#x27;node&#x27;...
nqzero超过 3 年前
do any of these json processing tools support wildcards in key names ? eg, &#x27;.long*&#x27; instead of &#x27;.longNameWithManyDetails&#x27;