Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.71 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.71 KB

beancount-ch

Convert monthly statements from some banks serving the Swiss market into beancount plain-text entries.

  • Cembra credit card statements (PDFs)
  • Revolut statements (CSVs)
  • BCV monthly statements (XLSX spreadsheets)

See https://c.pgdm.ch/code/beancount-ch

Note that beancount itself has importation tools: see this documentation page and beangulp.

Usage

beancount-ch
Parses a monthly statement and output it as Beancount entries

USAGE:
    beancount-ch [OPTIONS] <SUBCOMMAND>

OPTIONS:
        --accounts-rules-csv <ACCOUNTS_RULES_CSV>
            CSV with {text contained in merchant name}, {account} for expense account guessing

    -h, --help
            Print help information

SUBCOMMANDS:
    bcv        Monthly statements from BCV (XLSX format)
    cembra     Monthly credit card statements from Cembra (PDF format)
    help       Print this message or the help of the given subcommand(s)
    revolut    Revolut statements (CSV format)

A command of the form

$ cembra-beancount --accounts-rules-csv rules.csv cembra 2022-05.pdf

then produces beancount entries of the form

2022-05-01 * "Bakery Inc."
 Expenses:Food 15.80 CHF
 Liabilities:CreditCard
...

Account guessing

In many cases, the expense account (here Expenses:Food) can be guessed from the merchant name. The --accounts-rules-csv file contains simple rules of the form

 {text contained in merchant name}, {account}
 ...

applied sequentially until a match is found.