sniff
Reports file properties: detected or assumed encoding, field types, record count, and the CSV delimiter currently in use.
sniff does not auto-detect the CSV delimiter. The CLI default is --delimiter ,. A semicolon-separated file is reported as a single column unless you pass --delimiter ";". Use analyze when you need delimiter auto-detection.
Encoding is often unknown when sniff cannot determine it; pass --encoding to override.
# Report file properties (text output)
undatum sniff data.csv
# Semicolon CSV: pass the delimiter
undatum sniff data.csv --delimiter ";"
# Output as JSON (also --format-out json, or --output ending in .json)
undatum sniff data.jsonl --format-out json
# Output as YAML
undatum sniff data.csv --format-out yaml --output sniff.yaml
undatum sniff nested.jsonl --flatten-nested --format-out json
Reference
Reads: any readable format · Writes: report (see --format-out) · Memory: bounded: the beginning of the file · Engines: python
undatum sniff [OPTIONS] INPUT_FILE
| Argument | Description |
|---|---|
INPUT_FILE | Path to input file. (required) |
| Option | Description | Default |
|---|---|---|
-o, --output TEXT | Optional output file path. If not specified, prints to stdout. | |
-O, --format-out TEXT | Output format: 'text' (default), 'json', or 'yaml'. Also inferred when --output ends in .json/.yaml/.yml. | |
-d, --delimiter TEXT | CSV delimiter character (auto-detected when omitted). | |
--quotechar TEXT | CSV quote character (iterabledata default '"' when omitted). | |
--encoding TEXT | File encoding (e.g., 'utf8', 'latin1'). | |
--verbose / --no-verbose | Enable verbose logging output. | --no-verbose |
-F, --format-in TEXT | Override input file format detection (e.g., 'csv', 'jsonl'). | |
--table, --sheet TEXT | Table or sheet name for multi-table sources (Excel, SQLite, lakehouse). | |
--start-page INTEGER | Sheet index (0-based) for Excel files. | 0 |
--trust | Acknowledge pickle deserialization risk when reading pickle sources. | |
--on-error TEXT | Parse-error policy: raise (default), skip, or warn. | |
--error-log TEXT | Append parse errors as JSONL (use with --on-error skip or warn). | |
--flatten-nested | Unfold nested dict / array-of-dict fields into dotted paths (e.g. city.lat). | |
--max-nested-depth INTEGER | With --flatten-nested, maximum nest depth to unfold (engine default 5). | |
--keep-nested-parents / --no-keep-nested-parents | With --flatten-nested, keep parent dict/array fields alongside dotted children. | --keep-nested-parents |
--json | Print the result as one JSON document (same as --format-out json). |
Deprecated spellings (removed in 2.0): --format → --format-out.
See also shared options.