export.py either version gives me errors

2024-12-01 Thread fin


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 
main()
  File "/home/me/fin/beancount/stmon/export.py", line 359, in main
final_table = reorder_columns(joined_table, headers)
  ^^
  File "/home/me/fin/beancount/stmon/export.py", line 247, in reorder_columns
rows = [[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 
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 == 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.


Re: export.py either version gives me errors

2024-12-01 Thread Martin Blais
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 PM fin  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 
> main()
>   File "/home/me/fin/beancount/stmon/export.py", line 359, in main
> final_table = reorder_columns(joined_table, headers)
>   ^^
>   File "/home/me/fin/beancount/stmon/export.py", line 247, in
> reorder_columns
> rows = [[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 
> 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 == 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.
>

-- 
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/CAK21%2BhOpTmwt_NXotobGfZOrgLdb4LWd%2BPZJZxUzx8rCjpiEag%40mail.gmail.com.


Re: export.py either version gives me errors

2024-12-01 Thread fin
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


> --5b869d06283d9823
> 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  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 
>> 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 
>> 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.
>
> --5b869d06283d9823
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> ns-serif;font-size:small">I think you're using some obsolete code. I do=
> n't see this on the master branch. yle=3D"font-family:arial,sans-serif;font-size:small"> iv class=3D"gmail_quote">On Sun, Dec =
> 1, 2024 at 4:05=E2=80=AFPM fin fin@a=
> nthive.com> wrote:=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
> -left:1ex">
> Hello all,
>
>
>=C2=A0 I'm trying to get this script to run and getting errors
>
>
>=C2=A0 For version from 2.3.6 I get:
>
>
> (bc) me@ant(14)~/fin/beancount/stmon$ python export.py ledger.bc -c fin
> INFO=C2=A0 =C2=A0 : Operating currency: USD
> Traceback (most recent call last):
>=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 373, i=
> n 
>=C2=A0 =C2=A0 main()
>=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 359, i=
> n main
>=C2=A0 =C2=A0 final_table =3D reorder_columns(joined_table, headers)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
> ^^
>=C2=A0 File "/home/me/fin/beancount/stmon/export.py", line 247, i=
> n reorder_columns
>=C2=A0 =C2=A0 rows =3D [[row[index] for index in indexes] for row in table.=
> rows]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~~~^^^
> IndexError: list index out of range
>
>
>=C2=A0 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):
>=C2=A0 File "/home/me/fin/beancount/stmon/export.

Re: export.py either version gives me errors

2024-12-01 Thread fin
fin wrote:

  This script is also referenced in Beancount 3 doc at:

https://beancount.github.io/docs/beancount_v3.html

"Projects. The beancount/projects directory contains the export script and a 
project to produce data for a will. The will script will be moved outside the 
core of Beancount, I'm not sure anyone's using that. Maybe the new external 
plugins repo could include that script and other scripts I shared under 
/experimental. The export script should be grouped together with 
beancount/scripts/sql and other methods to send / share data outside of a 
ledger; these could remain in the core (I'm using the export script regularly 
to sync my aggregates and stock exposure to a Google Sheets doc which reflects 
intraday changes)."


  fin


> 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
>
>
>> --5b869d06283d9823
>> 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  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 
>>> 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 
>>> 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.
>>
>> --5b869d06283d9823
>> Content-Type: text/html; charset="UTF-8"
>> Content-Transfer-Encoding: quoted-printable
>>
>>> ns-serif;font-size:small">I think you're using some obsolete code. I do=
>> n't see this on the master branch.> yle=3D"font-family:arial,sans-serif;font-size:small">> iv class=3D"gmail_quote">On Sun, Dec =
>> 1, 2024 at 4:05=E2=80=AFPM fin fin@a=
>> nthive.com> wrote:>=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
>> -left:1ex">
>> Hello all,
>>
>>
>>=C2=A0 I'm trying to get this script to run and getting errors
>>
>>
>>=C2=A0 For version from 2.3.6 I get:
>>
>>
>> (bc) me@ant(14)~/fin/beancount/stmon$ python export.py ledger.bc -c fin
>> INFO=C2=A0 =C2=A0 : Operating currency: USD