JavaScript Object Notation

The json layout uses the json module to read and write records using an interface that looks like csv.

The difference between strict JSON and line-oriented json (txf.layouts.jsonl) is that strict JSON writes out all the records on one line as a JSON array.

class txf.layouts.json.LineReader(iterable, **config)

This is simply an alias for txf.jsonl.LineReader.

class txf.layouts.json.DictReader

This is simply an alias for txf.jsonl.DictReader.

class txf.layouts.json.LineWriter(outfile, fieldnames, **config)

This is simply an alias for txf.jsonl.LineWriter.

class txf.layouts.json.DictWriter(outfile, fieldnames, **config)

A txf.layouts.DictWriter that

writeheader()

Writes an initial [.

writerow(row)

Writes the row in JSON layout with a comma separator if necessary.

writefooter()

Writes a terminating ].