import csv
import json

""" Currency is dependant on your coinbase preferences """

data = {}
data['Transactions'] = []

with open('coinbase.csv','r') as csvfile:
    reader = csv.reader(csvfile)

    for i in range(8):
        next(reader)

    for line in reader:
        data['Transactions'].append({
            "Timestamp": line[0],
            "TransactionType":line[1],
            "Asset":line[2],
            "Quantity":line[3],
            "Price":line[4],
            "Subtotal":line[5],
            "Total":line[6],
            "Fees":line[7],
            "Notes":line[8],
        })

with open('parsedCoinbase.json', 'w') as outfile:
    json.dump(data, outfile)
