Bonobo in action ...

How to convert a file from JSON to CSV

Bonobo can be used to convert files from and to various data sources and file formats. You can use it from command line to convert a JSON file into CSV, or create a transformation if you need more flexibility or different transformation steps.

You do not need to know Python to use bonobo convert, only how to use a shell and have a shell where you can install python packages.


If you never used bonobo, you first need to install it. To know if bonobo is installed, you can run bonobo version (and it should be at least 0.5)

$ pip install bonobo

(read about more installation options in the documentation)

Convert JSON to CSV from command line

Simple as hell, just give the input and output file names to bonobo convert and you're good to go.

$ bonobo convert input.json output.csv

If bonobo can't detect your source file format (or your output does not end by .csv), you can provide input format, output format, or both as optional arguments in the command line.

$ bonobo convert --reader json input_file --writer csv output_file

Or the shorthand version...

$ bonobo convert -r json input_file -w csv output_file

Need more? Write your first transformation!

Writing a transformation is easy. Here is an equivalent transformation to the command line example above.

Create a file, and paste the following code:

import bonobo

graph = bonobo.Graph(

if __name__ == '__main__':

Now, you can use bonobo run to execute it.

$ bonobo run

If you're ready to go further and learn what you can do between the read and write phases, go ahead and read the 10 minutes to bonobo tutorial.

Happy format conversions!

Did I say we need feedback? Slack discussions and issues are more than welcome!