Use GPT to convert PDF bank statements to CSV
pip install pymupdf
python convert.py
Create a config file config.json
in the root directory:
{
"api_key": "YOUR-OPENAI-KEY",
"names": [],
"addresses": [],
"accounts": []
}
The script will also redact some basic keywords, stored in keywords.json
.
If you have Chat AI subscription, it might be more economical to use it's UI. link
Simply upload the pdf and it will output the CSV.
When importing the CSV to a credit card account, first select the credit account. Map the Account
column to Transfer Account
, Amount
to Amount (negated)
.
GPT infers the transaction type and save it to the Account
column.
For each transaction, infer the transaction type from its description:
If related to salary, Account is "Income:Salary:CAD";
If related to dining, Account is "Expenses:Dining";
If related to groceries, Account is "Expenses:Groceries";
If related to uber, lyft, flight ticket or other transportation, Account is "Expenses:Entertainment:Travel";
If related to hobbies (muay thai, martial arts, skiing), Account is "Expenses:Hobbies";
If related to any subscription service, Account is "Expenses:Subscriptions";
If related to parking, Account is "Expenses:Auto:Parking";
If related to gas or fuel, Account is "Expenses:Auto:Fuel";
For all the other expenses, Account is "Expenses:Adjustment"
- Login to Chase. Click "accounts".
- Click the "more" dropdown menu, choose "spending summary ", top right(on laptop, left on mobile)
- Click "download transactions" CSV is an option in the download drop-downs.
- Go to “Statements & Activity” and select the custom date range.
- Click the search button, which will display the transactions below.
- Click the Excel or CSV to download.
Click "Transactions -> Download Transactions"link