dot_files
jq
dot_files | jq | |
---|---|---|
1 | 306 | |
10 | 25,063 | |
- | - | |
1.8 | 0.0 | |
12 months ago | 11 months ago | |
Shell | C | |
- | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dot_files
-
Extracting Objects Recursively with Jq
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...
jq
-
GNU Parallel, where have you been all my life?
That should recursively list directories, counting only the files within each, and output² jsonl that can be further mangled within the shell². You could just as easily populate an associative array for further work, or $whatever. Unlike bash, zsh has reasonable behaviour around quoting and whitespace too.
¹ https://zsh.sourceforge.io/Doc/Release/User-Contributions.ht...
² https://github.com/jpmens/jo
³ https://github.com/stedolan/jq
- How do i edit reputation?
-
Jj: JSON Stream Editor
What I miss from jq and what is implemented but unreleased is platform independent line delimiters.
jq on Windows produces \r\n terminated lines which can be annoying when used with Cygwin / MSYS2 / WSL. The '--binary' option to not convert line delimiters is one of those pending improvements.
https://github.com/stedolan/jq/commit/0dab2b18d73e561f511801...
-
Building and deploying a web API powered by ChatGPT
If you have jq installed you can use it to make the output look nicer.
-
Search in your Jupyter notebooks from the CLI, fast.
It requires jq for JSON processing and GNU parallel for concurrent searches in the notebooks.
- Check the jq manual!
- mkv vs mp4 metadata
-
Amazon Begs Employees Not to Leak Corporate Secrets to ChatGPT
jq is your friend.
- Memes are all cool and all. But this is your daily remaining that 10000! =
-
How to export/import/externally-edit/whatever WI entries?
The jq command (https://stedolan.github.io/jq/) is useful pulling that information out.
What are some alternatives?
gojq - Pure Go implementation of jq
yq - Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
jfq - JSONata on the command line
dasel - Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
fzf - :cherry_blossom: A command-line fuzzy finder
jet - CLI to transform between JSON, EDN, YAML and Transit using Clojure
json5 - JSON5 — JSON for Humans
counsel-jq - Traverse complex JSON and YAML structures with live feedback
jp - Validate and transform JSON with Bash
setup - My config, system settings, utilities, etc.
nushell - A new type of shell