Skip to content

Instantly share code, notes, and snippets.

@pekevski
pekevski / to_csv.py
Created September 22, 2021 03:27
Convert a json file to csv in python
# pip install pandas
import pandas as pd
import sys
if len(sys.argv) is 2:
print(f'Error: 2 arguments required. Input file and output file. eg: to_csv.py file.json file.csv')
sys.exit()
input_file = sys.argv[1]
output_file = sys.argv[2]