Skip to content

Instantly share code, notes, and snippets.

@jbspeakr
Last active December 14, 2015 06:18
Show Gist options
  • Save jbspeakr/5041029 to your computer and use it in GitHub Desktop.
Save jbspeakr/5041029 to your computer and use it in GitHub Desktop.
Check http://www.datahack.it for further conversion snippets!
import csv
import json
i = open('input.csv', 'r')
reader = csv.DictReader(i)
data = json.dumps([row for row in reader], indent=4)
o = open('output.json', 'w')
o.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment