2485 shaares
83 private links
83 private links
easiest answer is with pandas as a library:
df = pd.read_json('inputfile.json')
df.to_csv('outputfile.csv', encoding='utf-8', index = False)
read_json converts a JSON string to a pandas object (either a series or dataframe).
to_csv can either return a string or write directly to a csv-file. See the docs for to_csv.
works best when json is an array of structured objects (unstructured data, see SO answer in link)
additional pandas to csv tips see this SO thread