Extracting Objects Recursively with Jq

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • gron

    Make JSON greppable!

  • I've really loved having jq at my disposal ever since learning about it, but I feel like it took the combination of it and gron [1] to just transform my debugging and JSON workflows.

    1: https://github.com/TomNomNom/gron

  • jq

    Discontinued Command-line JSON processor [Moved to: https://github.com/jqlang/jq] (by stedolan)

  • Whoa, I didn't know this existed. This does seem to address a lot of what I want. I wish that were more prominently linked to from https://stedolan.github.io/jq/.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • jet

    CLI to transform between JSON, EDN, YAML and Transit using Clojure (by borkdude)

  • jq is nice, but the moment i need anything more complex than "pull this attribute out of bunch of objects" i vastly prefer spinning up an actual language runtime. or use a tool built around a language (e.g. https://github.com/borkdude/jet) rather than a language built around a tool.

  • Hacker News API

    Documentation and Samples for the Official HN API

  • A bit offtopic, but I don't see much people knowing/using the Algolia API[0]. It's much better to use than the HN official API[1], since it returns the whole tree data in one request.

    Unfortunately (I guess this is a big reason why people don't use it), it doesn't sort the comments – if you need the orders, you'll have to parse HN HTML (or just use the official API).

    Still just two requests (the HN site, the Algolia API) is much better than recursively requesting a hundred requests, so I use this approach in my client[2].

    [0]: https://hn.algolia.com/api

    [1]: https://github.com/HackerNews/API

    [2]: https://github.com/goranmoomin/HackerNews

  • HackerNews

    macOS HackerNews client that aims to be a Mac-assed Mac app. Written in Swift + AppKit. (by goranmoomin)

  • A bit offtopic, but I don't see much people knowing/using the Algolia API[0]. It's much better to use than the HN official API[1], since it returns the whole tree data in one request.

    Unfortunately (I guess this is a big reason why people don't use it), it doesn't sort the comments – if you need the orders, you'll have to parse HN HTML (or just use the official API).

    Still just two requests (the HN site, the Algolia API) is much better than recursively requesting a hundred requests, so I use this approach in my client[2].

    [0]: https://hn.algolia.com/api

    [1]: https://github.com/HackerNews/API

    [2]: https://github.com/goranmoomin/HackerNews

  • dot_files

    My Shell configurations (by hoshsadiq)

  • I tend to use jq a lot. As others have said, sometimes jq can be hard to grasp. Often it requires multiple attempts to get the correct answer. To make it a little easier for me, I've written a helper function[0] that combines it with fzf[1] to run jq as a REPL on any json. It allows to incrementally alter your DSL without having to continually call jq. This is similar to jid/jiq but a little more powerful. It includes functions to change the preview to output raw, compact (or not), and some other things.

    I didn't use jid/jiq because jid uses go-simplejson, which is nowhere near as powerful as jq, and jiq seemed very buggy when I used it and it felt like it was hacked together. Plus there was no where to change jq's arguments while running it.

    I'm sure this function can be improved on, but this has been good enough for me so far.

    Also, I run gojq[2] instead of jq. It is a drop-in replacement for jq but is written in Go, and has some improvements over jq such as bug fixes, support for yaml input, and it also provides more helpful error messages.

    [0] https://github.com/hoshsadiq/dot_files/blob/master/zshrc.d/m...

  • fzf

    :cherry_blossom: A command-line fuzzy finder

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • gojq

    Pure Go implementation of jq

  • counsel-jq

    Traverse complex JSON and YAML structures with live feedback

  • If anyone is an emacs user and this sounds compelling, I recommend counsel-jq[0] for the sort of feedback loop described here.

    [0]: https://github.com/200ok-ch/counsel-jq

  • github-email

    Discontinued Get a GitHub user's email. All sneaky-like. :sunglasses:

  • Fairly simple script showing the jq, REST, and JSON trinity:

    https://github.com/DaveJarvis/github-email/blob/master/githu...

  • setup

    My config, system settings, utilities, etc. (by kbd)

  • Just sharing my take on that interactive jq (or anything else) repl:

    https://github.com/kbd/setup/blob/master/HOME/bin/fzr

    It's just an fzf wrapper that sets up temporary files and so on. It works really well; it's amazing all the things one can use fzf for.

  • jfq

    JSONata on the command line

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts