Martin Blais wrote: Martin, correct, it is a script referenced from beangrow via the following text:
"(Finally, note that if all you need is a snapshot of your current positions, that's already handled by the export script.)" which points at: https://github.com/beancount/beancount/blob/v2/beancount/projects/export.py since it is doing pretty much most of what i wanted it to do i was hoping to take it and adapt it to a project i'm working on. i didn't want to reinvent the wheel of having to figure out how to load all my transactions, apply all the plugins, and then have to calculate the positions via going through all the transactions and adjusting lots, etc. of trades through all the years. fin > --0000000000005b869d06283d9823 > Content-Type: text/plain; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > > I think you're using some obsolete code. I don't see this on the master > branch. > > > On Sun, Dec 1, 2024 at 4:05=E2=80=AFPM fin <f...@anthive.com> wrote: > >> >> Hello all, >> >> >> I'm trying to get this script to run and getting errors >> >> >> For version from 2.3.6 I get: >> >> >> (bc) me@ant(14)~/fin/beancount/stmon$ python export.py ledger.bc -c fin >> INFO : Operating currency: USD >> Traceback (most recent call last): >> File "/home/me/fin/beancount/stmon/export.py", line 373, in <module> >> main() >> File "/home/me/fin/beancount/stmon/export.py", line 359, in main >> final_table =3D reorder_columns(joined_table, headers) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> File "/home/me/fin/beancount/stmon/export.py", line 247, in >> reorder_columns >> rows =3D [[row[index] for index in indexes] for row in table.rows] >> ~~~^^^^^^^ >> IndexError: list index out of range >> >> >> For version from current master (3.1.0.dev0) I get: >> >> >> (bc) me@ant(17)~/fin/beancount/stmon$ python export.py ledger.bc -c fin >> Traceback (most recent call last): >> File "/home/me/fin/beancount/stmon/export.py", line 373, in <module> >> main() >> File "/home/me/fin/beancount/stmon/export.py", line 300, in main >> validate_entries(entries) >> File "/home/me/fin/beancount/stmon/export.py", line 48, in >> validate_entries >> if entry.flag =3D=3D flags.FLAG_UNREALIZED: >> ^^^^^^^^^^^^^^^^^^^^^ >> AttributeError: module 'beancount.core.flags' has no attribute >> 'FLAG_UNREALIZED' >> >> >> In either case I'm not a python guru yet enough to figure out >> what I am up against. When I examine indexes and table.rows things >> look ok to me. >> >> Thanks for any clues. >> >> >> fin >> >> -- >> 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+unsubscr...@googlegroups.com. >> To view this discussion visit >> https://groups.google.com/d/msgid/beancount/bjvu1l-75k.ln1%40anthive.com. >> > > --=20 > 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 e= > mail to beancount+unsubscr...@googlegroups.com. > To view this discussion visit https://groups.google.com/d/msgid/beancount/C= > AK21%2BhOpTmwt_NXotobGfZOrgLdb4LWd%2BPZJZxUzx8rCjpiEag%40mail.gmail.com. > > --0000000000005b869d06283d9823 > Content-Type: text/html; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > ><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,sa= > ns-serif;font-size:small">I think you're using some obsolete code. I do= > n't see this on the master branch.</div><div class=3D"gmail_default" st= > yle=3D"font-family:arial,sans-serif;font-size:small"><br></div></div><br><d= > iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Dec = > 1, 2024 at 4:05=E2=80=AFPM fin <<a href=3D"mailto:f...@anthive.com">fin@a= > nthive.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= >=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= > -left:1ex"><br> > Hello all,<br> ><br> ><br> >=C2=A0 I'm trying to get this script to run and getting errors<br> ><br> ><br> >=C2=A0 For version from 2.3.6 I get:<br> ><br> ><br> > (bc) me@ant(14)~/fin/beancount/stmon$ python export.py ledger.bc -c fin<br> > INFO=C2=A0 =C2=A0 : Operating currency: USD<br> > Traceback (most recent call last):<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 373, i= > n <module><br> >=C2=A0 =C2=A0 main()<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 359, i= > n main<br> >=C2=A0 =C2=A0 final_table =3D reorder_columns(joined_table, headers)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^^^^^^^^^^^^= > ^^^^^^^^^^^^^^^^^^^^^^^^^^<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 247, i= > n reorder_columns<br> >=C2=A0 =C2=A0 rows =3D [[row[index] for index in indexes] for row in table.= > rows]<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~~~^^^^^^^<br> > IndexError: list index out of range<br> ><br> ><br> >=C2=A0 For version from current master (3.1.0.dev0) I get:<br> ><br> ><br> > (bc) me@ant(17)~/fin/beancount/stmon$ python export.py ledger.bc -c fin<br> > Traceback (most recent call last):<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 373, i= > n <module><br> >=C2=A0 =C2=A0 main()<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 300, i= > n main<br> >=C2=A0 =C2=A0 validate_entries(entries)<br> >=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 48, in= > validate_entries<br> >=C2=A0 =C2=A0 if entry.flag =3D=3D flags.FLAG_UNREALIZED:<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= >=A0^^^^^^^^^^^^^^^^^^^^^<br> > AttributeError: module 'beancount.core.flags' has no attribute '= > ;FLAG_UNREALIZED'<br> ><br> ><br> >=C2=A0 In either case I'm not a python guru yet enough to figure out<br= >> > what I am up against.=C2=A0 When I examine indexes and table.rows things<br= >> > look ok to me.<br> ><br> >=C2=A0 Thanks for any clues.<br> ><br> ><br> >=C2=A0 fin<br> ><br> > -- <br> > You received this message because you are subscribed to the Google Groups &= > quot;Beancount" group.<br> > To unsubscribe from this group and stop receiving emails from it, send an e= > mail to <a href=3D"mailto:beancount%2bunsubscr...@googlegroups.com" target= >=3D"_blank">beancount+unsubscr...@googlegroups.com</a>.<br> > To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/= > beancount/bjvu1l-75k.ln1%40anthive.com" rel=3D"noreferrer" target=3D"_blank= > ">https://groups.google.com/d/msgid/beancount/bjvu1l-75k.ln1%40anthive.com<= > /a>.<br> ></blockquote></div> > ><p></p> > > -- <br /> > You received this message because you are subscribed to the Google Groups &= > quot;Beancount" group.<br /> > To unsubscribe from this group and stop receiving emails from it, send an e= > mail to <a href=3D"mailto:beancount+unsubscr...@googlegroups.com">beancount= > +unsubscr...@googlegroups.com</a>.<br /> > To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/= > beancount/CAK21%2BhOpTmwt_NXotobGfZOrgLdb4LWd%2BPZJZxUzx8rCjpiEag%40mail.gm= > ail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d= > /msgid/beancount/CAK21%2BhOpTmwt_NXotobGfZOrgLdb4LWd%2BPZJZxUzx8rCjpiEag%40= > mail.gmail.com</a>.<br /> > > --0000000000005b869d06283d9823-- > -- 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+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/beancount/63hv1l-ins.ln1%40anthive.com.