#json #ndjson #cli

bin+lib analyse-json

analyse-json is a CLI tool for inspecting (Newline Delimited) NDJSON or JSON to understand the contents

8 releases (4 breaking)

0.5.2 Jan 10, 2023
0.5.1 Jan 9, 2023
0.4.1 Dec 16, 2022
0.3.0 Jul 2, 2022
0.1.0 May 15, 2022

#416 in Text processing

33 downloads per month

MIT license

1.5K SLoC


CLI tool to analyse Newline Delimited (ND)JSON files and return useful metadata about the structure to help you understand the contents

    analyse-json [OPTIONS] [FILE_PATH]

    <FILE_PATH>    File to process, expected to contain a single JSON object or Newline
                   Delimited (ND) JSON objects

            Walk the elements of arrays treating arrays like a map of their enumerated elements?
            (E.g. $.path.to.array[0], $.path.to.array[1], ...) Ignored if using `--inspect-arrays`

    -g, --glob <GLOB>
            Process all files identified by this glob pattern

        --generate-completions <SHELL>
            Output shell completions for the chosen shell to stdout [possible values: bash, elvish,
            fish, powershell, zsh]

    -h, --help
            Print help information

            Walk the elements of arrays grouping elements paths together under `$.path.to.array[*]`?
            Takes precedence over `--explode-arrays`

        --jsonpath <JSONPATH>
            JSONpath query to filter/limit the inspection to e.g. `'$.a_key.an_array[0]'`

            Include combined results for all files when using glob

    -n, --lines <LINES>
            Limit inspection to the first n lines

            Use multi-threaded version of the processing

    -q, --quiet
            Silence error logging

    -V, --version
            Print version information


via cargo


You need to have cargo installed https://doc.rust-lang.org/cargo/getting-started/installation.html


cargo install analyse-json

Prebuild binaries

Prebuild binaries for some systems can be found on github


Changelog is available on github


~242K SLoC