Command line script to convert CSV/TSV files to AVRO
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4af0e4c Mar 21, 2015
Permalink
Failed to load latest commit information.
examples Improve with example Mar 17, 2015
src Improve with example Mar 17, 2015
.gitignore Initial commit Mar 17, 2015
LICENSE Initial commit Mar 17, 2015
README.rst Update README.rst Mar 22, 2015

README.rst

csv2avro

Command line script to convert CSV/TSV files to AVRO

Usage

usage: csv2avro.py [-h] [--dialect DIALECT] in_file out_file

csv2avro.py: error: too few arguments

Default dialect = 'excel-tab' - default python dialects are supported.

Example

python src/csv2avro.py examples/example.csv examples/example.avro --dialect excel

This will convert the example.csv into example.avro, which you can then read and verify has the same rows/content as you expect using the provided src/read.py:

python src/read.py examples/example.avro

{u'food': u'Pizza', u'name': u'Mike'}

{u'food': u'Pie', u'name': u'Ben'}

{u'food': u'Burgers', u'name': u'John'}

Count: 3

More Information

To learn more about why I wrote this utility, see my blog post: http://garrens.com/blog/2015/03/21/converting-csvs-with-headers-to-avro/