1import json
2import csv
3//string_data is your string in csv format
4json.dumps(list(csv.DictReader(string_data.splitlines(), delimiter=",")))
1# call csvkit (which is a Python tool) to convert json to csv:
2# https://csvkit.readthedocs.io/en/latest/
3
4in2csv data.json > data.csv