This repo contains 2 scripts for processing an mBank CSV file into a file supported by YNAB - in Elixir and in Python. Why? Because mBank transaction statements contain a lot of metadata that breaks stuff and the encoding is lame Windows-1250
- supports mBank and ING CSV files
- the script was written for Elixir 1.14, but there's nothing complicated in it not to work in other versions
- the script is assuming you have multiple accounts inside YNAB and it's meant to be used with any of them (maybe apart from credit card statements) - there should not be any duplicate transactions created in case you import files for transactions between them. It's mostly YNAB doing its job with matching, but it's worth to mention.
- the script was not tested with credit card statements - mBank's transactions list for them is very limited so personally I scrape them via Javascript script in browser.
Acknowledgements:
- Encoding inspired by this thread
- Script structure I learned from this lovely repo
- Populate the
accounts/0
function inBankParser
module for mapping accounts in transactions elixir bank_parser.exs <path to inputfile>
- A new file will be written to the same location as the input file, prefixed with
eYNAB_ready
- Go to YNAB
- Import file to appropriate account - be careful not to mix the imports :)
- Populate the
accounts/0
function inMbankParser
module for mapping accounts in transactions elixir mbank_parser.exs <path to inputfile>
- A new file will be written to the same location as the input file, prefixed with
eYNAB_ready
- Go to YNAB
- Import file to appropriate account - be careful not to mix the imports :)
Deprecation warning: the script works as of 06.2023, but it's kinda not very readable so I'm not going to support it
- the script is written for Python 3, although it should work under 2 as well
- the script is assuming having multiple accounts inside YNAB - you're prompted to decide about ignoring internal incoming transfers to avoid duplicate transactions (example for True: keeps A->B but ignores B<-A)
- you need to specify the account and credit card data in
constants.py
- name you would like to see in the file and the account number
- Create
constants.py
file from templatecp constants.template.py constants.py
python3 convert_csv.py <path to inputfile>
available options:
-h
- help
-c
- for parsing credit card csv
-ii
- for ignoring internal transactions
Note: Will work with paths from the same directory or from fullpath
Note: Output file will be named YNAB_ready_inputfile.csv
- Go to YNAB
- Import file to appropriate account
- maybe some screaming capslocked values for fields that don't have something relevant
- tests
- support for files from directory different than the one of the script
PR 4
- rewrote the script to Elixir
PR 3
- support for credit card statements
- introduced classes for account & credit card
- replaced getopt with argparse for command line arguments
- cleanup in command line arguments
PR 2
- refactored some stuff
- removed output file option (just generating the new file based on the input)
- prompting user for decision about ignoring internal incoming transactions
PR 1
- better fit with "Regularne oszczędzanie"
- better fit for transfers between owned accounts
- direct parsing for YNAB
This script is inspired by https://github.com/aniav/ynab-csv
If you have any other issues or suggestions, go to https://github.com/matisnape/mbank_ynab_parser/issues and create an issue if one doesn't already exist. If the issue has to do with your csv file, please create a new gist (https://gist.github.com/) with the content of the CSV file and share the link in the issue. If you tweak the CSV file before sharing, just make sure whatever version you end up sharing still causes the problem you describe.
- Fork and clone the project
- Make your changes locally and test them to make sure they work
- Commit those changes and push to your forked repository
- Make a new pull request