jello
Filter JSON and JSON Lines data using Python expressions
TLDR
SYNOPSIS
jello [options] [expression]
DESCRIPTION
jello filters JSON and JSON Lines data using Python expressions. The input data is deserialized and made available as the underscore (_) variable. Any valid Python expression can be used to transform, filter, or extract data.The tool combines jq-like filtering with Python's full expression power, including list comprehensions, dictionary methods, string operations, and standard library functions. It handles both JSON objects and JSON Lines (newline-delimited JSON) input.
PARAMETERS
EXPRESSION
Python expression (input is _).-p, --pretty
Pretty print output.-l, --lines
Output JSON lines.-r, --raw
Raw string output.-c, --compact
Compact JSON output (no pretty printing).-C
Force color output even when using pipes.-m, --mono
Monochrome output (no colors).-n, --nulls
Print selected null values.-s, --schema
Print the JSON schema in grep-able format.-t, --types
Print type annotations in schema view.-e
Empty data: initialize _ as None instead of reading input.-i
Initialize the data as a list for JSON Lines processing.-f FILE
Load input data from a JSON file.-q FILE
Load query from a file.-h, --help
Display help information.
CAVEATS
Requires Python 3.6 or later. Slower than jq for simple tasks due to Python startup overhead. The underscore (_) variable name is a convention and cannot be changed. Importing external modules is not supported by default.
HISTORY
jello was created by Kelly Brazil as a Python-based alternative to jq for users more familiar with Python syntax.
