Envelope Plugin for Fava

286 views
Skip to first unread message

Brian Ryall

unread,
May 9, 2020, 2:33:56 PM5/9/20
to Beancount


I am creating an envelope budgeting plugin for fava. I have finished the initial prototype (also uploaded to pypi) and I am looking for alpha testers and contributors to help improve this functionality. I know this has been a highly requested feature in the beancount community that I want to. I would love comments and suggestions to help improve this plugin

Thanks


About the plugin:
* It builds upon your beancount journal by using custom directives
* You specify which accounts you want in your budget
* You can map expenses to a new name


Future Additions:
* Charts (income/Expenses for budget accounts, etc)
* Output beancount report?

jus...@ryoohki.net

unread,
May 13, 2020, 11:18:16 AM5/13/20
to Beancount
On Sunday, May 10, 2020 at 1:33:56 AM UTC+7, Brian Ryall wrote:


I am creating an envelope budgeting plugin for fava.

I only took a brief look but from the github landing page it isn't clear what it does differently from the budgeting the fava already has:


I've never used fava's budgeting (or yours) so it might help potential users to explain what the differences between the two are. I do use envelope budgeting (YNAB) so I'll take another more detailed look later.

Cheers,
Justus

rjm...@gmail.com

unread,
May 16, 2020, 9:55:28 PM5/16/20
to Beancount
Thanks, awesome plugin. Envelope budgeting is one of the only features that beancount/fava is missing. Fava's current budgeting feature is not a true envelope system. This is a great start at implementing these features. A couple of comments:

* Errors are difficult to troubleshoot. If there is any error in fava-envelope, fava reports "Loading http://localhost:5000/example-file/extension/EnvelopeBudget/ failed." I don't know enough about fava, but is it possible to pipe errors from plugins into fava's error page?
* Is there any way to group all unmapped expenses into an unbudgeted envelope mapping by default?
* Would be easier if money could be allocated to an envelope once and then have fava-envelope assume that the allocations are the same each month, until the allocations are updated.

Brian Ryall

unread,
May 16, 2020, 10:45:55 PM5/16/20
to Beancount
fava's default budgeting just compares monthly spending to a value you specify. fava-envelope implements envelope budgeting similar to YNAB. Each month you can specify dollars to categories and positive envelope balances carry to the next moth (like if you are saving for a future expense)

Brian Ryall

unread,
May 16, 2020, 10:49:42 PM5/16/20
to Beancount
i will look into better error reporting. this is my first plugin to fava so I am not sure what is possible.

I do think repeating allocations would be useful (and also declutter beancount journal) i will add this to my list or contributions are always welcomed

Martin Blais

unread,
May 18, 2020, 5:23:53 AM5/18/20
to Beancount
Thanks for sharing Brian, I've added a link to the contribs doc.


On Sat, May 16, 2020 at 10:49 PM Brian Ryall <bry...@gmail.com> wrote:
i will look into better error reporting. this is my first plugin to fava so I am not sure what is possible.

I do think repeating allocations would be useful (and also declutter beancount journal) i will add this to my list or contributions are always welcomed

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/6cb13180-ba25-46a4-bb00-2f569b0eac02%40googlegroups.com.

Vinit Khandagle

unread,
May 22, 2020, 8:18:52 AM5/22/20
to Beancount
This is gona be really useful. I definitely would like to see this mature in Beancount. I used and tested MoneyDance and it has a good way to the envelope system. I really want to use this for beancount. I tried the steps mentioned on the git repo but I am not able to get this working. Fava keeps complaining that it failed to load the plugin looks like a very generic error. 

Vinit Khandagle

unread,
May 22, 2020, 8:26:58 AM5/22/20
to Beancount
Well I think this could be a possible thing happening is that the Flask route is not happening correctly for some reason

```
curl http://localhost:5000/beancount/extension/EnvelopeBudget/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

```

On Sunday, May 10, 2020 at 12:03:56 AM UTC+5:30, Brian Ryall wrote:

Brian Ryall

unread,
May 22, 2020, 9:25:35 PM5/22/20
to Beancount
probably need some better error reporting, I will look into this and see if I can see the issue

Red S

unread,
May 23, 2020, 4:53:21 AM5/23/20
to Beancount
In case this helps debug:

If you see this in the Fava error page: "Importing module "mymodule" failed."

That usually means the module was not able to be loaded. Try running python3 interactively and typing:

import mymodule

That should succeed, or tell you what the failure was.

Red S

unread,
May 23, 2020, 4:57:07 AM5/23/20
to Beancount
FWIW, what I've learned working with Fava extensions:
1. Understand failure to load the module by importing the module in an interactive python shell

2. If the module loads, error reporting on the console is easy and works well (print statements, logging)

Brian Ryall

unread,
May 24, 2020, 9:44:21 AM5/24/20
to Beancount
Was taking a look at this today, i definitely do not have enough error checks. going to try to add more in to make the extension loads even if there are errors. 

Errors I have found initially is, If you pick a start date that from that start date to the current date there are no transactions will cause that error

make sure you at least have the following lines:
```
2020-01-01 custom "envelope" "start date" "2020-01"
2020-01-01 custom "envelope" "budget account" "Assets:Checking"
2020-01-01 custom "envelope" "budget account" "Liabilities:Credit-Cards:*"
```
of course making sure the assets and liabilities names  match your beancount accounts

I will continue to try making the onboarding experience better as I continue developing this. trying to get some testing going to

Travis Dahlke

unread,
Jun 16, 2020, 11:00:42 AM6/16/20
to Beancount
Want to add I think this is an awesome start, I've been searching for something like this for a while.
I figured out I can "exclude" income from the budget if I just map the category to "Income" (e.g. Expenses:Taxes:Federal). Not sure if this is by design but this is something I have found lacking in other tools and I really dig it.

I'd like to jump in and help if I have some time because I think this can be a really great addition to beancount/fava.

polarmutex

unread,
Jun 16, 2020, 12:18:42 PM6/16/20
to Beancount
yea that feature was done on purpose. I wanted to leave the beacount files as is and allow a way to reduce the number of envelopes you have. For example, in beancount I have expenses categories for pretty specific items that I like to track, but for budgeting I just want the bare minimal envelopes to make budgeting easier. I never thought of mapping taxes to Income, I might have to do that, lol.

Feel free to create an issue on something you want to add or change. I can always give my opinion and help work through bugs. I think the bare essentials of features are there, and the plugin really needs more polish, error checking, and tests. I do want to add graphs in too at some point. 
Reply all
Reply to author
Forward
0 new messages