In my opinion, I prefer work with JSON file, but if you want to transform files, this code can be used, not really tested so you can add some modifications:
# json_to_csv.py
import json
import csv
import argparse
import sys
def flatten_json(y, prefix=''):
"""Recursively flattens a nested...