Scrapes transactions from online banking portals and uploads them to YouNeedABudget.com.
The project isn't on PyPI
Requirements:
- A supported backend for keyring. The Mac Keychain or Windows Credential Manager will do.
- Google Chrome.
- ChromeDriver. For a Mac with Homebrew, this can be done with
brew install chromedriver
. - Python 3.7+, pip, and poetry.
To install ynab you can use this script
bash install.sh
-
Create a file
~/.ynab.conf
with the following contents. Fill in any entries in angled brackets (<
,>
). Thesecrets_keys
entry should not contain any actual secrets, insert it as written:ynab: secrets_keys: access_token: ynab_access_token keyring: username: ynab
-
Head over to YouNeedABudget to generate a "personal access token".
-
Find out the budget id and account id that you would like to upload transactions to by using their API.
-
Choose one bank from the below list, fill in any entries in angled brackets, and add it to
~/.ynab.conf
. Values in<..>
should be filled out but everything else, particularly the "secrets_keys" section, should be pasted in verbatim.-
Amex:
sources: - type: amex username: <your amex username> secrets_keys: password: amex_password target: budget_id: <your budget id> account_id: <your account id>
-
Halifax:
sources: - type: halifax username: <your halifax username> secrets_keys: password: halifax_password challenge: halifax_challenge_password target: budget_id: <your budget id> account_id: <your account id>
-
HSBC:
sources: - type: hsbc username: <your hsbc username> secrets_keys: memorable_question: hsbc_memorable_question security_code: hsbc_security_code target: budget_id: <your budget id> account_id: <your account id>
-
Natwest:
sources: - type: natwest customer_number: <your natwest customer number> secrets_keys: password: natwest_password pin: natwest_pin target: budget_id: <your budget id> account_id: <your account id>
-
DKB:
sources: - type: dkb secrets_keys: anmeldename: dkb_anmeldename pin: dkb_pin target: budget_id: <your budget id> account_id: <your account id>
-
-
Open your keyring backend---on a Mac, this will be the KeyChain app--and create one entry for each secret for your bank and one for your access token. For example, if you have chosen Amex you will put in two entries
- Keychain Item Name:
amex_password
, Account Name:ynab
, Password:<your amex password>
- Keychain Item Name:
ynab_access_token
, Account Name:ynab
, Password:<your ynab personal access token>
- Keychain Item Name:
Simply run the command ynab
.
Dependencies are installed using poetry:
poetry install
To run tests:
poetry run python -m unittest discover
All files should be processed with black and isort before committing:
poetry run black .
poetry run isort --recursive