Bod instrument to csv

how to convert bod instrument json file to csv

Hi @Manju_48285748, The following Python code snippet might be useful.

import json
import csv

with open('instruments.json') as f:
    data = json.load(f)

all_keys = set()
for item in data:
    all_keys.update(item.keys())

fieldnames = sorted(all_keys)

with open('instruments.csv', 'w', newline='') as f:
    writer = csv.DictWriter(f, fieldnames=fieldnames)
    writer.writeheader()
    writer.writerows(data)