holdings

145 views
Skip to first unread message

david e

unread,
Jun 11, 2021, 11:24:00 AM6/11/21
to Beancount
Hello, I am new to beancount and still making small steps.

I am managing my trading positions with it and would like to get a better understanding of how to filter my data. 

for example, I run bean-report myfile.bean print quite often to check my entries and also bean-report myfile.bean holdings to have an overview of my portfolio, but I am wondering how to…

1) look at it from a specific perspective in time, for example how to print the portfolio for a specific start of a quarter, and…
2) how to list assets with bean-report myfile.bean holdings that have multiple cost basis entries as one holding.

thank you

D

Ben Blount

unread,
Jun 11, 2021, 11:26:58 AM6/11/21
to Beancount
Hi David both questions have been covered in this mailing list.
In short, use fava, not bean-report.

--
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/5bd08b8c-318f-494e-8963-41279d24a0d2n%40googlegroups.com.

Martin Blais

unread,
Jun 11, 2021, 11:27:46 AM6/11/21
to Beancount
- Don't use bean-report, it's obsolete; do all your work with bean-query


--

david e

unread,
Jun 11, 2021, 12:09:34 PM6/11/21
to Beancount
Thank you. 

Could you point me into the right direction how to use bean-query, for example to:

> list all entries for Expenses:Trading:Fees for a specific year and return the total 

I do have several similar queries and hope to get going once I know how to start.

I have no background in python but hope to get going with the docs.

redst...@gmail.com

unread,
Jun 15, 2021, 2:55:16 AM6/15/21
to Beancount
> I have no background in python but hope to get going with the docs.

You're on the right track. Fava and bean-query are both very well documented. I'd suggest working through the docs and asking specific questions if they still remain unanswered.

Jake Aust

unread,
Nov 28, 2021, 7:02:10 PM11/28/21
to Beancount
I've tried this script and it is spitting out errors. Any pointers what is going on?

Traceback (most recent call last):

  File "/Users/me/finances/beancount/reports/export.py", line 353, in <module>

    main()

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__

    return self.main(*args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main

    rv = self.invoke(ctx)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke

    return __callback(*args, **kwargs)

  File "/Users/me/finances/beancount/reports/export.py", line 330, in main

    final_table = reorder_columns(joined_table, headers)

  File "/Users/me/finances/beancount/reports/export.py", line 238, in reorder_columns

    rows = [[row[index] for index in indexes]

  File "/Users/me/finances/beancount/reports/export.py", line 238, in <listcomp>

    rows = [[row[index] for index in indexes]

  File "/Users/me/finances/beancount/reports/export.py", line 238, in <listcomp>

    rows = [[row[index] for index in indexes]

IndexError: list index out of range


Jake Aust

unread,
Nov 29, 2021, 6:29:40 PM11/29/21
to Beancount
Realized I wasn't super clear here. 

I tried the script Martin suggested in this thread because i need to spit out holding positions at any given time that show more than 2 decimals of precision (crypto). 
When I ran it on my beancount file, it generated the below errors. I don't know enough to understand how to debug what's going wrong...

Traceback (most recent call last):
  File "/Users/me/finances/beancount/reports/export.py", line 353, in <module>
    main()
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/me/finances/beancount/reports/export.py", line 330, in main
    final_table = reorder_columns(joined_table, headers)
  File "/Users/me/finances/beancount/reports/export.py", line 238, in reorder_columns
    rows = [[row[index] for index in indexes]
  File "/Users/me/finances/beancount/reports/export.py", line 238, in <listcomp>
    rows = [[row[index] for index in indexes]
  File "/Users/me/finances/beancount/reports/export.py", line 238, in <listcomp>
    rows = [[row[index] for index in indexes]
IndexError: list index out of range

Reply all
Reply to author
Forward
0 new messages