Mint Export to YNAB Import

August 10, 2021

Are you looking to switch from Mint to YNAB and want to import some existing data?

Here’s a quick script to translate a Mint CSV export to a YNAB CSV import.

    Convert transaction exports (CSV) into (you need a budget) CSV imports. transactions have the following fields:
     * Date
     * Description
     * Original Description
     * Amount
     * Transaction Type
     * Category
     * Account Name
     * Labels
     * Notes file imports expect the following fields:
     * Date
     * Payee
     * Memo
     * Amount
import csv
import sys
import typing

# This script translates the following fields:
# * Date => Date
# * Payee => Description
# * Memo => Original Description
# * Amount => Amount (Negative/Positive depending on transaction type)
MINT_FIELDS = ('Date', 'Description', 'Original Description', 'Amount')
YNAB_FIELDS = ('Date', 'Payee', 'Memo', 'Amount', 'Category')

def remap(fields: typing.Dict[str, str]) -> typing.Dict[str, typing.Any]:
    Given a mapping of fields, remap them to a new mapping based on our
    known rules.
    :param fields: Fields from transaction to remap to YNAB.
    amount = float(fields['Amount'])
    if fields['Transaction Type'] == 'debit':
        amount *= -1

    return {
        'Date': fields['Date'],
        'Payee': fields.get('Description', ''),
        'Memo': fields.get('Original Description', ''),
        'Amount': amount

def main(mint_path: str, ynab_path: str) -> None:
    Convert transactions to YNAB import format.

    :param mint_path: Path to transactions csv
    :param ynab_path: Path to save YNAB file import csv
    with open(mint_path, 'r', encoding='utf-8') as mint:
        with open(ynab_path, 'w', encoding='utf-8') as ynab:
            reader = csv.DictReader(mint)

            writer = csv.DictWriter(ynab, YNAB_FIELDS)

            for line in reader:

if __name__ == '__main__':

Simply use like:

python mint-transactions.csv ynab-transactions.csv

Unfortunately, YNAB CSV imports don’t support Category/Category Group values tickets here and here. I don’t understand this and it sucks but such is life.

Return home