I work a lot with CSVs and JSON, but didn't have a quick way of converting between the two until I added two command line scripts:
~/.local/bin/csv2json
#!/bin/bash
cat $1 | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > $2
~/.local/bin/json2csv
#!/bin/bash
cat $1 | python -c 'import sys,pandas as pd;
pd.read_json(sys.stdin).to_csv(sys.stdout)' > $2
Then just call them with
csv2json inputfile.csv outputfile.json
json2csv inputfile.json outpufile.csv