Skip to content
Beta · version 0.6.1 · commands and the JSON format may still change.

CLI: tabalyst inspect

Terminal window
tabalyst inspect INPUT... [OPTIONS]

Reads JSON, JSONL, NDJSON or Excel (.xlsx, .xlsm) files once and writes an Inspect file, <source>-inspect.json, beside each source. The file lists the collections or tables it found, says which one it selects and why, and holds the config section you can edit. CSV files, and the spreadsheet formats .xls, .xlsb and .ods, are refused with exit code 2. See Inspect JSON files and Inspect Excel workbooks.

OptionDescription
INPUT...One or more JSON, JSONL, NDJSON or Excel files, or non-recursive glob patterns (required)
-c, --config PATHJSON configuration file whose scan section seeds a new Inspect file; repeat to merge several, in order
--reset-configReplace the config of an existing Inspect file by the detected one
-f, --forceReplace an existing Inspect file that cannot be kept
-q, --quietSuppress success messages; warnings and the commands to choose from remain
-v, --verboseList every candidate collection, sheet or table, with its size and why it is not eligible
--no-progressDisable the progress line
--helpShow the options and exit

An existing Inspect file keeps its config when you inspect again. Inspect has no -o or -d: the file always goes beside its source.

Terminal window
tabalyst inspect sales.xlsx -v
Inspect: D:\work\sales.xlsx-inspect.json
Selection: $.Orders (much larger than $.Regions)
Format: excel
Candidates: 3
$.Orders (120 elements)
$.Regions (5 elements)
$.Notes (0 elements, no_header)
Warning [sales.xlsx]: $.Notes has no header row that Tabalyst can recognize.

tabalyst report sales.xlsx needs no choice.

Terminal window
tabalyst inspect shop.xlsx
Inspect: D:\work\shop.xlsx-inspect.json
Selection: none (several collections are equally plausible)
Warning [shop.xlsx]: 2 tables are equally plausible: $.Costs (40), $["Sales Q1"] (50). None was selected: set config.structure.dataset_path to the one to analyze.
Choose the table to analyze:
tabalyst report shop.xlsx --collection Costs
tabalyst report shop.xlsx --collection '$["Sales Q1"]'
Or report every table: tabalyst report shop.xlsx --all-collections

Copy a line to run it. The short form (Costs) is used whenever the name is plain, and the quoted path otherwise. A JSON file works the same way:

Terminal window
tabalyst inspect shop.json
Choose the collection to analyze:
tabalyst report shop.json --collection customers
tabalyst report shop.json --collection orders
Or report every collection: tabalyst report shop.json --all-collections
Terminal window
tabalyst inspect "exports/*.xlsx" "logs/*.jsonl"
tabalyst inspect shop.json --config settings.json
tabalyst inspect shop.json --reset-config
CodeWhen
0Every Inspect file was written, even when no collection could be selected
2Invalid options, a source Inspect does not read, or an invalid Inspect file
4A source is missing, unreadable or invalid