CLI: tabalyst insights
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.
Output files
Section titled “Output files”| Source | Main page | Profile | Column pages |
|---|---|---|---|
data.csv, data.json, data.xlsx | data.insights.html | data.insights.json | data.insights/col-01-<column>.html |
With --all-collections: shop.xlsx | shop.<collection>.insights.html | shop.<collection>.insights.json | shop.<collection>.insights/ |
With -o out.html | out.html | out.json | out/ |
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.
Options
Section titled “Options”INPUT... is required: one or more files, scan documents with --scan, or
non-recursive glob patterns.
| Option | Description |
|---|---|
-o, --output PATH | HTML 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 PATH | Folder for the pages, named after their sources. Required by --all-collections with several inputs |
-c, --config PATH | JSON configuration file. deep.mode set to off is an error |
-f, --force | Replace existing Insights files |
-q, --quiet | Suppress success messages; warnings and errors remain |
-v, --verbose | Also show the profile and history paths, and the encoding and delimiter of a CSV file |
--no-progress | Disable the progress line |
--workers N | Worker 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, --yes | Start a costly second pass without asking. Outside a terminal, a costly second pass needs it |
--dedup-report PATH | A 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 TEXT | CSV: one-character delimiter, instead of the detected one |
--encoding TEXT | CSV: text encoding, instead of the detected one |
--collection TEXT | JSON or Excel: the part of the file to analyze. See Choosing a collection or a table. Not with --scan or --all-collections |
--all-collections | JSON or Excel: the pages of every visible collection of each file, as <name>.<collection>.insights.html. Not with -o, --collection or --scan |
--scan | The 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 |
--help | Show the options and exit |
An option that a kind of file cannot use is ignored, with a warning, as for
tabalyst report.
Second pass
Section titled “Second pass”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
--yesto skip it; - outside a terminal (a script, a pipe, CI), a costly pass stops with exit code
3and nothing is started, unless--yesis 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.
Examples
Section titled “Examples”tabalyst insights customers.csvtabalyst insights data/*.csv -d insightstabalyst insights customers.csv -o out/customers.html --forcetabalyst insights orders.jsontabalyst insights shop.xlsx --all-collections -d insightstabalyst insights big.csv --yesExit codes
Section titled “Exit codes”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.