jmespath / jmespath.py

JMESPath is a query language for JSON.
http://jmespath.org
MIT License
2.19k stars 181 forks source link

Add jpp which is an extended superset of the jp command #224

Open zmedico opened 3 years ago

zmedico commented 3 years ago
$ jpp --help
usage: jpp [-h] [-a] [-c] [-e EXPR_FILE] [-f FILENAME] [-r] [-R] [-s] [-u] [--unquoted] [--ast] [expression]

  jpp is an extended superset of the jp CLI for JMESPath

positional arguments:
  expression

optional arguments:
  -h, --help            show this help message and exit
  -a, --accumulate      Accumulate all output objects into a single recursively merged output object.
  -c, --compact         Produce compact JSON output that omits nonessential whitespace.
  -e EXPR_FILE, --expr-file EXPR_FILE
                        Read JMESPath expression from the specified file.
  -f FILENAME, --filename FILENAME
                        The filename containing the input data. If a filename is not given then data is read from stdin.
  -r, --raw-output      If the final result is a string, it will be printed without quotes (an alias for --unquoted).
  -R, --raw-input       Read raw string input and box it as JSON strings.
  -s, --slurp           Read one or more input JSON objects into an array and apply the JMESPath expression to the resulting array.
  -u, --unbox           If the final result is a list, unbox it into a stream of output objects that is suitable for consumption by --slurp mode.
  --unquoted            If the final result is a string, it will be printed without quotes.
  --ast                 Only print the AST of the parsed expression. Do not rely on this output, only useful for debugging purposes.

There's also a golang implementation in https://github.com/jmespath/jp/pull/30.