Use list.pop(0) instead and output CSV instead of json