Created
March 26, 2015 07:31
-
-
Save behumble/de6bc0189d85edf197e7 to your computer and use it in GitHub Desktop.
flat key,value only (useful for i18n)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import json | |
import csv | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
if len(sys.argv)<2: | |
print "json file name please" | |
sys.exit(1) | |
json_file = sys.argv[1] | |
json = json.loads(open(json_file).read()) | |
csv_writer = csv.writer(open(json_file+'.csv', 'wb')) | |
for item in json.items(): | |
csv_writer.writerow(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment