# Beancount getting started

**URL:** https://forum.mustachianpost.com/t/beancount-getting-started/2701
**Category:** Life Hacking
**Created:** [October 31, 2019, 11:21am UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701 "2019-10-31T11:21:08Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [April 8, 2020, 3:25pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/22 "2020-04-08T15:25:41Z")

</div>

If you’re familiar with docker, that’s the way I would go. Otherwise maybe the easiest way for s to use wsl.

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 8, 2020, 11:28pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/23 "2020-04-08T23:28:33Z")

</div>

My seutp is, and i am mosly very happy:

- WSL Ubuntu 18.04, with a win10 host
- VScode for text editing & transaction checking. awesome beancount plugin available!
- miniconda for python encapsulation
- private github repo for version control & backup
- git-crypt to encrypt that repo before pushing (once set up it disappears from the typical git workflow)
- beancount, smart-importer, tariochbctools for revolut importer, fava
- lots of time to get started, but very satisfied in the end

in the beginning i also tried docker, but it was too much of new stuff at the time. you can read up about it further up in the thread 😁 among others I had the problem of accessing the localhost fava webapp through the docker container shell.

unfortuanately a good tutorial for getting started is not available to my knowledge. there is a section in the documentation, but the author and all the beancount community suffer heavily from the [Curse of knowledge](https://en.wikipedia.org/wiki/Curse_of_knowledge)

some sources I used:

[Beancount - Syntax Cheat Sheet - Google Docs](https://docs.google.com/document/d/1M4GwF6BkcXyVVvj4yXBJMX7YFXpxlxo95W6CpU3uWVc/edit)  
[Beancount - Index - Google Docs](https://docs.google.com/document/d/1RaondTJCS_IUPBHFNdT8oqFKJjVJDsfsn6JEjBG04eA/edit)  
[Beancount Google Groups](https://groups.google.com/forum/#!forum/beancount)  
[Awesome Beancount | awesome-beancount](https://awesome-beancount.com/)  
[Command-line Accounting in Context — Beancount 2.0b3 documentation](https://aumayr.github.io/beancount-docs-static/users/cl_accounting.html)  
[Alex Johnstone - Managing my personal finances with beancount](https://alexjj.com/blog/2016/managing-my-personal-finances-with-beancount/)  
[Vince Cima](https://www.vincecima.com/2016/06/12/the-surprising-ease-of-plain-text-accounting.html)  
[Docker Container on Windows host system: how to access mapped ports? - Docker Desktop for Windows - Docker Forums](https://forums.docker.com/t/docker-container-on-windows-host-system-how-to-access-mapped-ports/86034)  
[Browsable & searchable Documentation for Beancount — Beancount 2.0b3 documentation](https://aumayr.github.io/beancount-docs-static/contents.html)  
[beancount-import/ofx.py at master · jbms/beancount-import](https://github.com/jbms/beancount-import/blob/master/beancount_import/source/ofx.py)

my tutorial would be: start as simple as possible (bare beancount & fava) and add your taste as you go. don’t try to do everything at once. Read the google doc documentation, but don’t be disappointed if it doesnt help very much when you look for something specific.

In the end I made it and I don’t think in a glorious way xD so any IT-person should be able to do so too. And with me there is one more person willing to answer question 🙂

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 9, 2020, 7:15pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/24 "2020-04-09T19:15:40Z")

</div>

> [@MeowMeowFuzzyface](#):
>
> config.py:

did you by chance copy the wrong text for the config.py?

---

<div class="post-metadata">

### Author: ![Ed\_Waadt](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/ed_waadt/32/1732_2.png) [@Ed\_Waadt](https://forum.mustachianpost.com/u/Ed_Waadt)
#### Post date: [April 10, 2020, 12:04pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/25 "2020-04-10T12:04:47Z")

</div>

Thanks for all the details!

I’m trying to migrate my GNUCash file. I had problems with splits and dates but I modified the Python sourcecode and it was okay. Then with accounts with an ampersand, that’s okay too.

Still, it’s a mess. I’m visualizing my beancount result file after all these fixes and there is no order or information. It’s as if everything was wrong. I’m thinking, maybe I should start from scratch in 2021? Manually update both of them for a while to see where I feel better?

@nugget what’s your experience with the migration?

---

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [April 10, 2020, 12:51pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/26 "2020-04-10T12:51:18Z")

</div>

I did the migration as well and it took a bit to clean it up afterwards but was totally worth it, having all the history in there. I also split my stuff into multiple files.

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 10, 2020, 12:55pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/27 "2020-04-10T12:55:17Z")

</div>

i remember it worked, but it was nowhere next to “clean”

i vaguely remembering that i used some gnucash2beancount converter. it was a pain. it required some ancient gnucash format, so i installed some specific version where i then could export my files in a format that the convrter would accept. finally i did end up with a coherent beancount version of my gnucash data.  
and as tarioch writes, i had to manually edit quite alot of the entries. partly because i refurbished my account tree and used the opportunity to resolve inconsistencies of my bookkeeping. a good text editor (i used vscode) and regex are your friend here 😉

but, again as tarioch writes, it was totally worth it from today’s perspective

---

<div class="post-metadata">

### Author: ![Ed\_Waadt](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/ed_waadt/32/1732_2.png) [@Ed\_Waadt](https://forum.mustachianpost.com/u/Ed_Waadt)
#### Post date: [April 11, 2020, 12:41pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/28 "2020-04-11T12:41:14Z")

</div>

Would you mind sharing some screenshots? I’m utterly demotivated and almost about to give up.

This is what I see after I fixed all the errors:

 ![image](https://forum.mustachianpost.com/uploads/default/original/2X/6/6a689408f5fcab425bb059d52699bf629f310771.png)

Not really useful, huh?

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 11, 2020, 2:06pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/29 "2020-04-11T14:06:52Z")

</div>

yes, you got the first part of the typical beancount feeling ^^  
for me it looks like

 ![image](https://forum.mustachianpost.com/uploads/default/original/2X/8/8676c0690ce91063006b967271d1b9456d364c90.png)

---

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [April 11, 2020, 2:46pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/30 "2020-04-11T14:46:10Z")

</div>

Could be related to currencies and missing prices, what prices do you have in your beancount file?

---

<div class="post-metadata">

### Author: ![Ed\_Waadt](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/ed_waadt/32/1732_2.png) [@Ed\_Waadt](https://forum.mustachianpost.com/u/Ed_Waadt)
#### Post date: [April 11, 2020, 4:30pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/31 "2020-04-11T16:30:19Z")

</div>

First of all, thanks!

I did translate my historical prices from the GNUCash file alright, at least I think so. For example:

```
2016-12-29 price VTI 115.75 USD
2016-12-28 price VTI 115.74 USD
2016-12-27 price VTI 116.71 USD
2016-12-23 price VTI 116.42 USD
2016-12-22 price VTI 116.24 USD

```

And also currencies:

```
2020-04-03 price EUR 1.05555 CHF
2020-04-02 price EUR 1.05617 CHF
2020-04-01 price EUR 1.0579 CHF
2020-03-31 price EUR 1.06 CHF
2020-03-30 price EUR 1.0587 CHF

```

Currently bean-check is throwing some errors on transactions that do not balance in some shares and dividends transactions (not all of them, just a few). For example:

```
mblt.beancount:36724: Transaction does not balance: (-12.730 USD)`
           2018-06-21 * "Buy VTI Total Stock Market ETF"
         Assets:Investments:Brokerage-Accounts:TradeDirect:TradeDirect-USD:Vanguard-Total-Stock-Market-ETF-VTI 7.0 VTI @ 143.09 USD
         Assets:Investments:Brokerage-Accounts:TradeDirect:TradeDirect-USD -1014.360 USD
         Expenses:Bank-Service-Charge:Banking-fees 0.0 CHF

```

And I also have a problem with easyJet for some reason (so glad I sold that with a profit):

```
mblt.beancount:378: syntax error, unexpected COLON, expecting EOL or COMMENT

```

mblt.beancount:378: Invalid token: ‘easyJet’

The line reads:

`2015-12-31 open Income:Dividend-Income:Dividend-Income-GBP:easyJet GBP`

Apart from that, no other errors are showing so I’m quite puzzled.

I’d like to thank @nugget also for proposing his help.

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 11, 2020, 4:57pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/32 "2020-04-11T16:57:50Z")

</div>

Hey Ed,

> [@Ed\_Waadt](#):
>
> historical prices

i think that looks good!

> [@Ed\_Waadt](#):
>
> transactions that do not balance in some shares and dividends transactions (not all of them, just a few).

my transactions look like (buy & sell)

```
2017-08-04 * "VTI" "buy VTI @ 126.94 USD" 
  Assets:Invest:IB:VTI 81 VTI { 126.94 USD } ; buy shares: provide cost "{}"
  Assets:Invest:IB:USD -10282.14 USD 
  Assets:Invest:IB:USD -0.28 USD 
  Expenses:Invest:IB:Fees:USD 0.28 USD

2017-07-27 * "VWRL" "sell VWRL @ 76.28 CHF" 
  Assets:Invest:IB:VWRL -206 VWRL { } @ 76.28 CHF ; sell shares: provide price @ xx.xx USD"
  Assets:Invest:IB:CHF 15713.68 CHF 
  Income:Invest:IB:VWRL:PnL ; have a PnL account to balance the transaction on sales
  Assets:Invest:IB:CHF -16.81 CHF 
  Expenses:Invest:IB:Fees:CHF 16.81 CHF

```

mind that i have the “cost” `{ 126.94 USD }` on purchase, “price” `@ 143.09 USD` and a PnL account on sale. That’s a somewhat unintuitive thing of bookkeeping. There is a chapter in the docs about it. Please read it, i would not know how to get it right without understanding what’s written there.  
just change thy syntax so it matches mine, and some of your errors will dissipate.

> [@Ed\_Waadt](#):
>
> Income:Dividend-Income:Dividend-Income-GBP:easyJet

First Character Of Each Account Needs To Be Capitalized

hope this helps abit 🙂

---

<div class="post-metadata">

### Author: ![Ed\_Waadt](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/ed_waadt/32/1732_2.png) [@Ed\_Waadt](https://forum.mustachianpost.com/u/Ed_Waadt)
#### Post date: [April 11, 2020, 5:20pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/33 "2020-04-11T17:20:15Z")

</div>

I did not specify an operating currency, that’s why I was seeing nothing.

Also, I had to delete GNUCash’s annual book closings.

Thanks for the CamelCase tip!!

I’ll see how to balance those transactions, it’s not getting translated well.

I will still need some help but this is improving.

Now I’m just losing a lot of money (not right) 🤣

 ![image](https://forum.mustachianpost.com/uploads/default/original/2X/2/2de9c5e8e87b19a85ad4dad612c2c69f5702e6ab.png)

Thank you, guys!

---

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [April 11, 2020, 5:34pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/34 "2020-04-11T17:34:57Z")

</div>

This actually looks good, in beancount, income is negative, expenses positive, so that’s what you want it to look like.

---

<div class="post-metadata">

### Author: ![Ed\_Waadt](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/ed_waadt/32/1732_2.png) [@Ed\_Waadt](https://forum.mustachianpost.com/u/Ed_Waadt)
#### Post date: [April 11, 2020, 6:54pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/35 "2020-04-11T18:54:05Z")

</div>

I see. It seems counterintuitive that the net profit is negative even though you are putting some money aside every month

---

<div class="post-metadata">

### Author: ![Setsugetsu](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/s/54ee81/32.png) [@Setsugetsu](https://forum.mustachianpost.com/u/Setsugetsu)
#### Post date: [April 25, 2020, 9:13am UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/36 "2020-04-25T09:13:46Z")

</div>

Hello Beancounters, I am considering to start using Beancount myself, it definitely looks cool. So far I have only been tracking “Balance sheets” for all my accounts, but not transactions.

I managed to install everything on Windows using WSL. I was playing with the example file and Fava and I have couple of questions:

- Since Beancount does not track the prices of my assets automatically, I need to prize them manually. At what frequence do you add these? Daily? Weekly? Monthly? I assume that Beancount will take the last price, so if I want monthly reports, I’d have to add monthly prices of all my assets to the last day of the month.

- How do you track your savings rate? I wasn’t able to find it in Fava. I assume I could do a custom query, but isn’t there an easier way?

- How do you track your portfolio allocations (stocks, bonds, cash) and stock allocations (US, EU, …, emerging)?

- How do you track of other FI metrics? “Months until FI”, “Current FI progress %”, …

Thanks in advance!

---

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [April 25, 2020, 1:58pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/37 "2020-04-25T13:58:52Z")

</div>

- Prices: I have a cronjob that daily pulls prices from a couple of sources ( alphavantage, exchangeratesapi), see [https://github.com/tarioch/beancounttools](https://github.com/tarioch/beancounttools)
- Allocation: I have meta annotation on my commodities that specify the alloction percentage
- allocation metrics, savings rate, …: This depends on your needs and programming skills: I created a custom reporting website that uses queries to build all kind of metrics and graphs, but this is very specific to my setup and my needs

Beancount is basically just an “accounting” engine.

---

<div class="post-metadata">

### Author: ![Tino](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/tino/32/2374_2.png) [@Tino](https://forum.mustachianpost.com/u/Tino)
#### Post date: [April 25, 2020, 3:26pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/38 "2020-04-25T15:26:30Z")

</div>

Hi,

> [@Setsugetsu](#):
>
> Since Beancount does not track the prices of my assets automatically,

The setup for automatic prices is easy. You can do a cron work every day with something like that:

`bean-price --no-cache main.bean >> prices.bean`

Later in the main.bean you include the file prices.bean and you’ll have all the prices for any stock automatically updated every day.

> [@Setsugetsu](#):
>
> How do you track your portfolio allocations (stocks, bonds, cash) and stock allocations (US, EU, …, emerging)?

For that the best in my opinion is working with tags. Exemples:

2020-04-21 \* “IB” “Buy VEUR” #Buy #VEUR #ETF #Europe #Whatever  
Assets:ETF:VEUR 100 VEUR {25.455 EUR}  
Expenses:Comission:IB 1.27 EUR  
Assets:Account:IB -2546.77 EUR

Later you can filter by tags, I’m using fava for that. Another technique is using different Assets for different stocks, e.g. Assets:ETF:Europe:VEUR and Assets:ETF:US:VTI, Assets:Stock:US:KO, etc. Later you can filter by _US_ or _ETF_ to have the distributions.

> [@Setsugetsu](#):
>
> How do you track your savings rate?

I don’t track that but is easy to check by month, years, etc. In Income Statement you have

[Income] -1000 [Expenses] 800 [Net Profit] 200  
So for me is easy to have those values.

Regards.

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 25, 2020, 3:33pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/39 "2020-04-25T15:33:29Z")

</div>

@Tino @tarioch  
i see you use cronjob, i want to do the same. Since my machine is off a lot, i looked into fcron for the feature of `bootrun` , an option that allows to run overdue tasks at system startup if they had been scheduled for during off time.

do you know how to get this working? fcron as such works nicely, but the line

`&nice(10),bootrun 0 * * * * echo " we sent an email based on fcrontab entry $(date)" >> ~/myfiles/fcron/testlog.log`

will only append to the logfile only when the machine is on. same for  
`&bootrun 0 * * * * ~/myfiles/fcron/testemailscript.sh`  
thanks!

---

<div class="post-metadata">

### Author: ![nugget](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nugget/32/57_2.png) [@nugget](https://forum.mustachianpost.com/u/nugget)
#### Post date: [April 25, 2020, 3:40pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/40 "2020-04-25T15:40:29Z")

</div>

@tarioch  
what is the advantage of your alphavantage script over the bean-price solution provided by @Tino ?

---

<div class="post-metadata">

### Author: ![Tino](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/tino/32/2374_2.png) [@Tino](https://forum.mustachianpost.com/u/Tino)
#### Post date: [April 25, 2020, 3:41pm UTC](https://forum.mustachianpost.com/t/beancount-getting-started/2701/41 "2020-04-25T15:41:16Z")

</div>

Honestly I don’t have any idea for windows, did you try [https://stackoverflow.com](https://stackoverflow.com)? I did a quick check and I found several solutions… did you try them?

> <https://stackoverflow.com/questions/7195503/setting-up-a-cron-job-in-windows/21502661#21502661>

Regards.

[Previous page](https://forum.mustachianpost.com/t/beancount-getting-started/2701.md?page=1)

[Next page](https://forum.mustachianpost.com/t/beancount-getting-started/2701.md?page=3)
