Skip to content

harrybiddle/ynab

Repository files navigation

Maintainability Test Coverage

YNAB

Scrapes transactions from online banking portals and uploads them to YouNeedABudget.com.

Installation

The project isn't on PyPI

Requirements:

  1. A supported backend for keyring. The Mac Keychain or Windows Credential Manager will do.
  2. Google Chrome.
  3. ChromeDriver. For a Mac with Homebrew, this can be done with brew install chromedriver.
  4. Python 3.7+, pip, and poetry.

To install ynab you can use this script

bash install.sh

Configuration

  1. Create a file ~/.ynab.conf with the following contents. Fill in any entries in angled brackets (<, >). The secrets_keys entry should not contain any actual secrets, insert it as written:

    ynab:
      secrets_keys:
        access_token: ynab_access_token
    keyring:
      username: ynab
  2. Head over to YouNeedABudget to generate a "personal access token".

  3. Find out the budget id and account id that you would like to upload transactions to by using their API.

  4. 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>
  5. 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>

Usage

Simply run the command ynab.

Development

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published