Beancount advancement Thread

here is my current (randomized data…) IB-to-beancount import excel sheet.
So far it features stocks and Forex transactions, Dividends and Witholding Tax.
It’s by no means a clean solution and requires adjustments to the labeling of your bean accounts, but if you spend 10 minutes on how the strings are gnerated, you will quickly be able to adjust it to your need.

the manual, just after @Tino’s guide above:

  1. get the default activity statement from IB of the time u like like annual or year to date in CSV format

    2.open with excel or a text editor, find the sections with “Trades”, “Dividends” and “witholding Tax” in the first column. copy paste to the accorting place in my Excel sheet. Dividends and Witholdong taxes go side-by-side, not after each other. replace my random data, it is there to have a working example.
  2. adjust the account namings to your conventions (one-time effort)
  3. copy the column BT (“VSCODE sttings”) to your ledger
    image
  4. search & replace the ***** tags by newline

bean-check your document :slight_smile:

1 Like

Thanks for sharing @nugget ,
Is like you explain that I did. Your method is much more elaborated :wink: Congratulations! You are becoming an expert!
Sometimes is painful all this imports but once everything is in place, writing down each movement in your finances is really quick and easy.

Since I’m doing I discovered several fees and expenses that I wasn’t aware. Also I found some patterns in my expenses that helped me to control them.

In case it helps others, especially those familiar with Docker, I created a docker container which includes Beancount, Fava, the Beancount smart importer and an “amortize_over” plugin. You can then run the whole shebang really easily without having to install everything.

I run this using Docker Compose, with something like this:

version: '3.7'

services:
  fava:
    image: alexiri/fava:latest
    ports:
      - "5000:80"
    volumes:
      - /mnt/kube/fava:/data
    environment:
      BEANCOUNT_INPUT_FILE: "/data/main.beancount"
    restart: unless-stopped

  prices_fava:
    image: alexiri/fava:latest
    volumes:
      - /mnt/kube/fava:/data
    entrypoint: /bin/sh
    command:
      - '-c'
      - '/usr/local/bin/bean-price -i /data/main.beancount 2>/dev/null | sort >> /data/generated/prices.beancount'
    restart: 'no'

The fava container is always running, and prices_fava is run once a day to update my prices.beancount file. I also have importers for Revolut, UBS and a few other foreign banks, but the code would need to be cleaned up before I can share it.

4 Likes

this is incredibly awesome :heart_eyes:
if i got the concept of docker correct, we should be able to have all the common addons (Postfinance, IB, DKB, whatever) and thus have a platform where beancount just works?

Yes, that’s certainly possible. What I have now has all the beancount files and importers outside of the container, but I suppose it would be possible to ship the importers as part of the container as well.

I made importers for Cashback Swisscard, Cumulus Creditcard and Raiffeisenbank. They work for me. One thing that is not fixed yet is that Umlaute are not encoded correctly into the .beancount file

2 Likes

Hey guys, I was doing a little research to find a simple tool to track my net worth and found nothing. All the big players like Personal Capital, YNAB & Mint are targeted at US market and automatically draw transactions from your accounts using your logins (no thanks).

Then there is GNUCash, but it seems like an overkill to what I want to achieve, and I saw people tried it and then dumped it. Is Beancount really the best alternative here? I don’t really want to hack too much, I just want to have a wealth curve and maybe track the total turnover: income vs expenses.

In my research I found some Google Sheets based tools, like Tiller, but it is not very popular, and it is also quite expensive. Most of these tools charge you like $10 per month, which I find a lot for the added value. I think it would make sense to have a tool that uses a Spreadsheet as source of data, because you can easily modify it.

My expectations for the net worth tracker would be:

  • ability to manually input my transactions & bulk import with CSV (I hold CSV extracts from my old bank accounts)
  • ability to match internal money transfers (i.e. I send CHF from my money account to my broker account, then the tool converts it into a single transaction, which does not affect the turnover)
  • automatic tracking of securities: VT, VWRL, BTC, ETH etc.
  • easy to use, good looking

I guess doubly entry bookkeeping provides needed depth, so it’s worth to use it, but when I read up on it, it seemed not so straightforward. You have to learn what goes into Db and what into Cr, and I would have to manually process all transactions.

For a long time I thought I won’t bother to calculate my net worth, but at this point I have a bank account, two brokers, some cryptos, credit card & revolut, and it’s hard to keep track of it.

I was thinking the same and also thought on building my own tool. It has to generate an output readable from fava to avoid building all the eye candy stuff, at least at the beginning. Once you have that, you can easily build tools to rewrite csv in a manageable form (json in my case) and everything should be easier. The google sheet export tool is also on my list.
For now I’ve done a simple telegram bot that reads my configuration and create a series of questions to create a possible CSV line or a beancount/whatever entry. I just didn’t do the last part because I"m not sure what to do. probably a local storage that can be downloaded later.

I tested about a dozen apps, also the ones that you have mentioned. None of them did exactly what I wanted unless you paid for it. Then I started doing my own google sheets formula to enter each expense manually and make some charts until I discovered beancount through this forum. I think combined with fava it just offers all the tools that I want and there is even some budgeting option that I haven’t explored yet. Doing importers for .csv files or spreadsheets is quite straightforward, PDF files were quite annoying…Atm I plan to make a google spreadsheet for manual entries through my iPhone that will then translate into a beancount file.

1 Like

Hi Bojack,

I’ve been using Beancount and Porfolio Performance in parallel for some months now.
Since I’m used to work with plain files, git, etc… beancount is nice but need learning and sometimes is frustrating. In my case because the accounting understanding or terms, not the program itself :wink:

Portfolio Performance is more for stocks, crypto, ETF, gold, etc… Is the best program I found and it’s free! I tried to help them with some money but they are not collecting money right now.

Porfolio Perfomance has a big problem for me that the 90% of support or documentation is in German but I thing lot of you speak well German so won’t be a problem. The main interface is also in English.

I’m happy with both and using in parallel help me to maintain consistency my personal economy :wink:

If Gnucash is overkill to you, better keep off beancount :smiley:
I liked it, but now that i see how much better curencies work with beancount, i dont want to go back. however, i still hardly understand anything that beancount provides :see_no_evil::see_no_evil:

I saw both now (and before my excel-sheets / google sheets).
double-entry bookkeeping allows you to be much more robust & find possible mistakes. also, all money is really accounted for, which my old excel-sheets could not provide. Gnucash of course works fine in this regard.

Tracking your securities: easy in google sheets, less in excel. Gnucash has some third-party plugin (that i never managed to be productive, but that might not be the creator’s fault. Beancount excels here, as long as your security is listed with yahoo. i have not found other sources for beancount so fat (google quit a while ago).

1 Like

I am just using google sheets with google forms for input for my expenses. And another google sheets for tracking my networth using the googlefinance tool.

Works pretty well for me since I am just doing some simple graphs… Also handling different currencies is easy (which most programs do not provide).

Of course far away from double accounting, all depends what you want…

So I installed Beancount with Fava. It was a PITA, because I own a MacBook, and macOS is kinda like Linux, but stuff is missing. So, if anybody finds themselves in a similar situation:

  1. install xcode command line tools
  2. install homebrew
  3. install python 3
  4. install fava (it will install beancount too)
  5. add Python bin folder to environment path, otherwise you won’t be able to start fava from anywhere

So these points above is exactly what I was trying to avoid. I hate this Linux dependency tweaking stuff, I feel too old for this :stuck_out_tongue: . But after I’ve done it, and generated the example beancount file, I can enjoy the nice web GUI. Right now I am reading the documentation of Beancount on double entry bookkeeping, to understand how I need to enter this stuff.

I gotta say, it’s a lot of initial effort, but once done, you have really nice overview of where your money goes, which will hopefully ease my anxiety regarding my financial overview. Right now it’s a mess.

1 Like

You should try docker

come again? I heard about Docker, saw the whale icon somewhere, but don’t know exactly how it works. Care to shed some light?

Btw: I managed to copy paste my PostFinance transactions to Excel, then reformatted them to Beancount format. It’s not so straightforward. Are there any import/convert tools that you guys know? I guess I could save to CSV format more easily using Excel.

I added an importer for Revolut. Make sure to read the comments. The Readme contains an example for the .import File. Basically you don’t need to rename or do any changes to any of the files that the importers support. Just have all the Files in a single folder - in my case the Downloads folder.
Importers

to me, as a docker noob, it worked the following way:
get docker application for your system ( in my case docker desktop for windows)
then clone (same workflow as with github, the commands i forgot, but any tutorial on docker cloning will hav it) Alex’ container from the post above
build & run the container (all some commands, like docker run -i )
et voila, you have a system sandbox in front of you that allows you to do some beancounting. I can offer to show you via desktop sharing if interested, just pm me

hey, would there be interest in a dedicated meetup for exchange on beancount? I am happy to share what i got so far. But I actually think i havnt grasped the potential of beancount yet. and of course, if i could learn this way something…

of there are 3 positive replies, i’ll organize / host a meetup!

2 Likes

I’m using beancount for a couple of years and really happy with it. Went from Spreadsheets and Gnucash to use beancount.
As a developer beancount works very well.
I have importers for revolut, transferwise, zkb and price importer for alphavantage (free prices for a lot of stocks/etf).
As I just switched to ib I still have to write that one, but I see that there is even a way to fetch a selected report automatically (flex query api) it should be very nice.
If there’s interest I can see about releasing the tools and create a docker with all of them in it.

4 Likes

So Docker is some kind of Virtual Machine software? And a Docker Container is a clone/image that somebody else prepared, with all the necessary software installed?

Is there any risk that such a pre-cooked container can do some spying on you? You don’t know exactly what is in there, or?

And what is the advantage of Docker over traditional VM software?

I would find a Beancount session very helpful. I can tell you that I work with core banking software, and in there the transactions and postings are modelled in the same way, using plus and minus to represent debits and credits. Although its all stored in an Oracle database, not a flat file :wink: