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

CLI: tabalyst insights

Terminal window
tabalyst insights INPUT... [OPTIONS]

Analyzes CSV, JSON, JSONL or Excel (.xlsx, .xlsm) files and writes, for each one, the pages of Tabalyst Insights: a main page with the table of every column, a page for each column and the JSON profile, plus an executions.json history in the same folder. The sources are never modified.

Insights always runs the second pass, as tabalyst report --deep does: it asks first when it is costly. See Second pass.

SourceMain pageProfileColumn pages
data.csv, data.json, data.xlsxdata.insights.htmldata.insights.jsondata.insights/col-01-<column>.html
With --all-collections: shop.xlsxshop.<collection>.insights.htmlshop.<collection>.insights.jsonshop.<collection>.insights/
With -o out.htmlout.htmlout.jsonout/

The files go beside the source, or in the folder of -d. They never replace the files of tabalyst report, so both commands can write beside the same source. With --force, the pages of columns the source no longer has are removed.

INPUT... is required: one or more files, scan documents with --scan, or non-recursive glob patterns.

OptionDescription
-o, --output PATHHTML filename of the main page, ending in .html, for a single input. The profile takes the same name with .json. Not with -d or --all-collections
-d, --output-dir PATHFolder for the pages, named after their sources. Required by --all-collections with several inputs
-c, --config PATHJSON configuration file. deep.mode set to off is an error
-f, --forceReplace existing Insights files
-q, --quietSuppress success messages; warnings and errors remain
-v, --verboseAlso show the profile and history paths, and the encoding and delimiter of a CSV file
--no-progressDisable the progress line
--workers NWorker processes that analyze values: 1 for one process. Files of 16 MiB or more use one per spare processor by default. Not with --scan
-y, --yesStart a costly second pass without asking. Outside a terminal, a costly second pass needs it
--dedup-report PATHA Dedup report, or the folder holding the one of each source, that proves the copies of rows behind the uniqueness of identifier columns. CSV sources only. As for tabalyst report
--delimiter TEXTCSV: one-character delimiter, instead of the detected one
--encoding TEXTCSV: text encoding, instead of the detected one
--collection TEXTJSON or Excel: the part of the file to analyze. See Choosing a collection or a table. Not with --scan or --all-collections
--all-collectionsJSON or Excel: the pages of every visible collection of each file, as <name>.<collection>.insights.html. Not with -o, --collection or --scan
--scanThe inputs are scan documents written by tabalyst scan. The second pass still reads each source again. Not with --delimiter, --encoding, --collection, --all-collections or --workers
--helpShow the options and exit

An option that a kind of file cannot use is ignored, with a warning, as for tabalyst report.

The second pass reads each source again for the exact analyses the scan lacks: distinct counts, frequencies, medians, patterns counted on every value and more. Insights always runs it, so its profile is the one tabalyst report --deep writes. When its estimate passes the thresholds (several minutes, or more memory than the budget), Insights shows the estimate and asks once for the whole batch:

  • in a terminal, answer the question, or give --yes to skip it;
  • outside a terminal (a script, a pipe, CI), a costly pass stops with exit code 3 and nothing is started, unless --yes is given.

The line after the path says what the second pass did:

Second pass (forced): 160 analyses, 160 computed, 0 reused.

A second pass stored beside the scan is reused while the source is unchanged.

Terminal window
tabalyst insights customers.csv
tabalyst insights data/*.csv -d insights
tabalyst insights customers.csv -o out/customers.html --force
tabalyst insights orders.json
tabalyst insights shop.xlsx --all-collections -d insights
tabalyst insights big.csv --yes

The codes of the command line: 0 success, 1 analysis or output failure, 2 invalid configuration or a collection to choose, 3 a costly second pass not confirmed, 4 input error.