import json# import csvimport unicodecsv as csvwith open('input.json') as data_file: data = json.loads(data_file.read())with open('output.csv', 'wb') as csv_file: writer = csv.writer(csv_file, encoding='utf-8') writer.writerow(['id', 'date', 'name']) for row in data: item_id = row['id'] created = row['created'] name = row['title'] row = [item_id, created, name] writer.writerow(row)
NOTE: to support unicode in CSV, you need unicodecsv