How to use plugin in beancount (beancount.plugins.implicit_prices) ?

48 views
Skip to first unread message

Booster Hidrogen

unread,
Aug 2, 2020, 4:18:09 AM8/2/20
to Beancount
Hi, sorry for stupid question because I'm still not so sure how to use plugin, for example >plugin "beancount.plugins.implicit_prices", any references how to use it ? thanks

Martin Michlmayr

unread,
Aug 2, 2020, 5:40:12 AM8/2/20
to bean...@googlegroups.com
* Booster Hidrogen <booster...@gmail.com> [2020-08-02 01:18]:
> Hi, sorry for stupid question because I'm still not so sure how to use
> plugin, for example >plugin "beancount.plugins.implicit_prices", any
> references how to use it ? thanks

You add the following line to your .beancount file to activate the
plugin:

plugin "beancount.plugins.implicit_prices"

That's it. When you add this plugin, price info via @ and @@ will
generate price entries.
--
Martin Michlmayr
https://www.cyrius.com/

Martin Michlmayr

unread,
Aug 2, 2020, 5:47:40 AM8/2/20
to bean...@googlegroups.com
* Martin Michlmayr <t...@cyrius.com> [2020-08-02 17:40]:
> You add the following line to your .beancount file to activate the
> plugin:
>
> plugin "beancount.plugins.implicit_prices"
>
> That's it. When you add this plugin, price info via @ and @@ will
> generate price entries.

Full example. Put this in test.beancount:

;---------------------
plugin "beancount.plugins.implicit_prices"

2000-01-01 open Assets:Bank
2000-01-01 open Expenses:Snacks

2020-08-02 * "Bought chocolate"
Expenses:Snacks 1.00 EUR @ 0.90 GBP
Assets:Bank -0.90 GBP
;---------------------

Now run:

bean-report test.beancount print | grep price

This will show:

2020-08-02 price EUR 0.90 GBP

This was generated by the implicit_prices plugin.

Booster Hidrogen

unread,
Aug 2, 2020, 7:56:33 AM8/2/20
to Beancount
Thank you for the examples, so basically the built in plugin isn't directly editing the beancount file.

Martin Michlmayr

unread,
Aug 2, 2020, 8:09:39 AM8/2/20
to bean...@googlegroups.com
* Booster Hidrogen <booster...@gmail.com> [2020-08-02 04:56]:
> Thank you for the examples, so basically the built in plugin isn't directly
> editing the beancount file.

Correct. Beancount plugins modify the entries (in memory) when the
file is loaded by beancount.

Martin

Reply all
Reply to author
Forward
0 new messages