8000 GitHub - thowi/pybank: Python modules and scripts to download bank account data from banking websites. · GitHub
[go: up one dir, main page]

Skip to content
thowiPublic

About

Python modules and scripts to download bank account data from banking websites.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

Python modules and scripts to download bank statements and import them into Beancount.

Set up the virtual environment and install requirements.

I'm using uv to create a virtual environment and install the dependencies:

$ uv venv
$ source .venv/bin/activate
$ uv sync

I recommend using (direnv)[https://direnv.net/] to automatically activate the environment in your shell when entering the directory. Setup for this project:

$ echo 'export VIRTUAL_ENV=".venv"\nlayout python' > .envrc
$ direnv allow

Run

Two entry points, pybank-import and pybank-fetch. Run either with --help for details.

$ uv run pybank-import --config "$config" extract "$statements" > "$outfile"

The config is TOML, mostly one section per institution. The optional [accounts] table names the accounts that several importers book to. Each key is optional:

[accounts]
bank_fees = "Expenses:Fees:Bank"
fx_fees = "Expenses:Fees:ForeignExchange"  # The spread of a conversion.
opening_balances = "Equity:Opening-Balances"
withholding_tax = "Expenses:Taxes:Withholding"

[ibkr] needs cash and securities. [ibkr], [schwab.brokerage] and [schwab.eac] take withholding_tax from [accounts] unless they name their own.

Development

$ uv run pytest
$ uv run ruff check
$ uv run ruff format

The review page of pybank-import review-ui is a React app in web/. Its build goes into src/pybank/web/static/:

$ cd web && npm install && npm run build

Web scrapers

The selenium scrapers under src/pybank/download are unmaintained. They are kept for reference until replaced, see docs/plans. They need:

$ brew install geckodriver chromedriver

About

Python modules and scripts to download bank account data from banking websites.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

0