Skip to content
Chris Mattmann edited this page Aug 23, 2026 · 1 revision

TSV to JSON

This document explains how to use tsvtojson in console.

Using tsvtojson in Console Explained:

After completion of installation go to the ettlib/etl/ directory. Write the following following command in console:

$ tsvtojson

tsvtojson: Usage: tsvtojson [-v] [-t tsv file] [-j json file] [-o object type] [-c column headers txt file] [-u unique field]

Options: -t tsv file, --tsv=file

`Parse the given TSV file and turn it into JSON.`

-j json file --json=file

`Output the named JSON file.`

-c column headers file --cols=file

`Use the provided column headers to parse the TSV and to name fields in the JSON.`

-o object type --object=type

`Wrap the list of objects for each row in the TSV file in the named JSON object type. `

-u unique field --unique=field

`Identifies a unique field per record in the TSV so that duplicate JSON files are not created.`

-v, --verbose

`Work verbosely rather than silently.`

It shows the default options available for usage. Now let's structure a sample input:

$ tsvtojson -t NameOfYourTsv -j NameOfYourOutputJson -c NameOfFileForColumnHeads -o NameofObjectType -u NameOfUniqueField

$ tsvtojson --tsv=NameOfYourTsv --json=NameOfYourOutputJson --cols=NameOfFileForColumnHeads --object NameofObjectType --unique=NameOfUniqueField

For ex:

$ tsvtojson --tsv=computrabajo.tsv -j somefile.json -c test.txt -o employment

ETLLib Wiki

ETLLib — mung, then load.

Source and issues

Website

Start here

Old

Python 2.7, buildout, and bootstrap.py notes live under Old. Original URLs still resolve via stubs.

Clone this wiki locally