Feature Comparison
You already know Python. Why learn another DSL?
jq / yq β powerful but you need to learn a custom query language:
# jq: filter users older than 30
jq '[.[] | select(.age > 30)]' users.json
# fimod: same thing, it's just Python
fimod s -i users.json -e '[u for u in data if u["age"] > 30]'
# jq: project + sort + deduplicate
jq '[.[] | {id, name}] | sort_by(.name) | unique_by(.id)' data.json
# fimod: chain expressions, each feeds the next
fimod s -i data.json -e '[{"id": u["id"], "name": u["name"]} for u in data]' \
-e 'it_unique_by(it_sort_by(data, "name"), "id")'
# yq: convert YAML β JSON (yq can't output TOML or CSV)
yq -o json config.yaml
# fimod: any format β any format
fimod s -i config.yaml -e 'data' -o config.toml
Python one-liner β works but painful boilerplate:
python3 -c "
import json, sys
data = json.load(sys.stdin)
print(json.dumps([u for u in data if u['active']]))
" < users.json
# fimod: same logic, zero boilerplate, no Python install
fimod s -i users.json -e '[u for u in data if u["active"]]'
Matrix
| jq | yq | Python script | fimod | |
|---|---|---|---|---|
| Language | jq DSL | jq-like DSL | Python | π’ Python |
| JSON | β | β | manual I/O | π’ built-in |
| YAML | β | β | manual I/O | π’ built-in |
| TOML | β | β (read-only) | manual I/O | π’ built-in |
| CSV | β | β (limited) | manual I/O | π’ built-in |
| NDJSON | β (--slurp) | β | manual I/O | π’ built-in (--slurp) |
| Cross-format | β | YAMLβJSONβXML | manual | π’ any β any |
| Dependencies | jq binary | yq binary | Python + pip | π’ single binary |
| Binary size | ~2 MB | ~10 MB | ~30-100 MB (standalone) | π’ ~2.3 MB (UPX-compressed) |
| Regex | limited | limited | import re |
π’ re_* built-in (PCRE2) |
| Deep access | .a.b.c |
.a.b.c |
manual | π’ dp_get(data, "a.b.c") |
| Group/sort/unique | group_by |
group_by |
manual | π’ it_group_by, it_sort_by, it_unique_by |
| Hashing | β | β | import hashlib |
π’ hs_sha256, hs_md5, hs_sha1 |
| In-place edit | sponge hack | -i |
manual | π’ --in-place |
| Batch files | loop | loop | loop | π’ fimod s -i *.json -m t.py -o out/ |
| Chaining | | (inside jq) |
| (inside yq) |
manual | π’ -e expr1 -e expr2 |
| Exit codes | β | β | sys.exit() |
π’ --check + set_exit() |
| Reusable scripts | β | β | yes | π’ mold scripts + registry |
| Remote scripts | β | β | β | π’ -m https://... |
| HTTP input | β | β | requests + boilerplate |
π’ -i https://... (replaces curl) |
| Test runner | β | β | pytest | π’ fimod test mold.py tests/ |