Tabalyst ToolsAvailable

Find where the records are.

A JSON file can hold several arrays and a workbook several sheets. Tabalyst Inspect reads the file once, finds which array, sheet or table holds the records and writes its answer in a file beside the source, which you can edit.

A JSON exportThe collection is found
tabalyst inspect orders.json
Inspect: orders.json-inspect.json
Selection: $.customers[] (the only eligible collection)
A workbookSo is the sheet
tabalyst inspect sales.xlsx
Inspect: sales.xlsx-inspect.json
Selection: $.Orders (much larger than $.Regions)

Real output of tabalyst 0.6.1, paths shortened.

The tool

One question, answered before the analysis

  • 01 / JSON AND JSONL

    Which array holds the records?

    Inspect reads a JSON, JSONL or NDJSON file once, lists the arrays it finds and selects the collection of records. When several are equally plausible, it says so instead of guessing.

  • 02 / EXCEL

    Which sheet, which table, which header row?

    For a .xlsx or .xlsm workbook, Inspect lists the sheets and named tables, proposes one and notes where its header row is, even under a title.

  • 03 / EDITABLE

    An answer you can correct

    The result is a file beside the source. Its config section holds the rules that scan and report apply: edit it, then run them as usual. Inspecting again refreshes the detection and keeps your config.

Inspect is optional. tabalyst scan and tabalyst report inspect a JSON file themselves when it has no Inspect file. Use it when you want to see, check or change the choice before the analysis.

Get started

Inspect a source, then use the answer

  1. 1 · Install
    pip install tabalyst

    # Also updates it: Tabalyst changes often

  2. 2 · A JSON file
    tabalyst inspect orders.json

    # Writes orders.json-inspect.json beside the source

  3. 3 · A workbook
    tabalyst inspect sales.xlsx

    # Lists sheets and named tables, writes sales.xlsx-inspect.json

  4. 4 · Use the choice
    tabalyst report orders.json

    # Report and scan apply the config of the Inspect file

Real output

The file it writes

The Inspect file of orders.json, shortened. Everything outside config is replaced each time Tabalyst inspects the source.

orders.json-inspect.jsonWhat was found, and the rules to apply
{
  "format": "tabalyst.inspect",
  "format_version": "0.1.0a",
  "format_revision": 1,
  "detection": {
    "candidates": [{
      "path": "$.customers[]",
      "elements": 60,
      "eligible": true
    }],
    "selection": {
      "path": "$.customers[]",
      "basis": "only_eligible_candidate"
    }
  },
  "config": {
    "structure": { "dataset_path": "$.customers[]" },
    "flatten": { "enabled": true, "separator": "." },
    "arrays": { "mode": "preserve" },
    "errors": { "policy": "strict" }
  }
}

Some fields are left out. For a workbook, config.structure also holds header_row.

Scope, not hype

What to know before you rely on it

  • Inspect reads JSON, JSONL, NDJSON and Excel (.xlsx, .xlsm) files. A CSV file is refused with exit code 2: there is nothing to find in a CSV.
  • When several arrays or tables are equally plausible, scan and report stop before analyzing anything and list the candidates. Choose one in the Inspect file or with --collection.
  • A table is selected per report. Blocks of a sheet separated by blank rows are not split into tables: only a named Excel table creates a candidate.
  • Older .xls files are not read, and the Inspect file format is still experimental.

The known limitations ↗ list the rest.

Next step

Where to go next