Skip to content

Data formats ​

Complete specification for CSV, JSON, and JSONL/NDJSON input.

CSV / TSV (.csv, .tsv) ​

RFC 4180 compliant parser with extensions.

Delimiter auto-detection ​

First line scanned for delimiter: comma (,), semicolon (;), tab (\t). No config needed.

Force delimiter:

json
// lakreet.config.json
{ "delimiter": ";" }

Quoting (RFC 4180) ​

CaseInputParsed value
Basichellohello
With comma"hello, world"hello, world
With newline"line1\nline2"line1\nline2
Escaped quote"He said ""Hi"""He said "Hi"
Leading/trailing space" padded " padded

Quotes preserved verbatim (not stripped).

BOM handling ​

UTF-8 BOM (\uFEFF) stripped automatically. Works with Excel "UTF-8 with BOM".

Line numbers ​

Errors reference 1-based line numbers (header = line 1):

Line 5, column "Opacity": "abc" is not a number.

Column count ​

All rows must match header column count. Mismatch = error:

Line 8: expected 3 columns, found 4.

Comment columns ​

Headers starting with # ignored:

csv
Source Text,Opacity,#internal_id
Budi,100,row-001

JSON (.json) ​

Array of objects ​

json
[
  { "Source Text": "Budi", "Opacity": 100 },
  { "Source Text": "Sari", "Opacity": 60 }
]

Object with rows key ​

json
{
  "rows": [
    { "Source Text": "Budi", "Opacity": 100 },
    { "Source Text": "Sari", "Opacity": 60 }
  ]
}

Type preservation ​

JSON typeControl typeExample
stringtext"Budi"
numberslider100, 75.5
booleancheckboxtrue, false
nulltext"" (empty)

Missing keys = validation error (unless --empty-as-default for text).

JSONL / NDJSON (.jsonl, .ndjson) ​

One JSON object per line. Ideal for large datasets.

jsonl
{"Source Text": "Budi", "Opacity": 100}
{"Source Text": "Sari", "Opacity": 60}
{"Source Text": "Andi", "Opacity": 25}
  • Empty lines skipped
  • Each line = valid JSON
  • Line numbers in errors = JSONL line number

Validation rules (all formats) ​

RuleError example
Column matches controlColumn "Foo" is not a control
Slider = finite number"abc" is not a number
Checkbox = boolean"yes" is not a boolean
Media file existsfile not found: /path/missing.png
Required columns presentcolumn "Source Text" is required

Next steps ​

Independent project. Not affiliated with the ArtCraft team or the EffectCraft project.