ofx-summarize: a quick and dirty way to peek inside a .ofx file

113 views
Skip to first unread message

Red S

unread,
Aug 5, 2022, 2:22:57 AM8/5/22
to Beancount

I was finally able to get a bunch of tools I use the TLC they needed. I cleaned them up, added nice click-based command line interfaces, and checked them in to beancount-reds-importers and fava-investor. I'll be posting about them soon, starting with this one. Enjoy.

When building importers, it helps to be able to peek into a .ofx or a .qfx file that you are trying to import. The ofx-summarize command does just that. It ships with beancount-reds-importers, and should be available by simply invoking the command. Running the command on a file shows you a few transactions in the file. What is very useful is to be able to explore your .ofx file via the python debugger or interpreter. Here is an example:

Here is a sample session:

Total number of accounts: 2
----------------
Account info:   01234567 Vanguard
Statement info: 2021-07-04 21:00:00 -- 2021-08-05 00:05:52. Bal: [(Decimal('123.45'), '6789'), ...]
Types:  {'buymf', 'sellmf', 'income', 'reinvest'}

2021-05-12 21:00:00 reinvest DIVIDEND REINVESTMENTDIVIDEND REINVESTMENT -678.90
2021-05-10 21:00:00 buymf MONEY FUND PURCHASE -12.10
2021-05-17 21:00:00 income DIVIDEND PAYMENTDIVIDEND PAYMENT 23.45
2021-05-18 21:00:00 sellmf MONEY FUND REDEMPTION 11223344.55
Hints:
- try dir(acc), dir(acc.statement.transactions)
- try the 'interact' command to start an interactive python interpreter
- type 'c' to explore the next account in this file
(Pdb)

From here, you can use the hints above to explore each transaction in the account.

Ben Blount

unread,
Aug 5, 2022, 1:27:02 PM8/5/22
to bean...@googlegroups.com
This is great, thanks so much for all you do for the community!

--
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/46616906-02d8-46c4-b0fd-523a4c27af63n%40googlegroups.com.

Martin Blais

unread,
Aug 5, 2022, 3:06:55 PM8/5/22
to Beancount
Indeed!
I've added links to the contrib doc.

Red S

unread,
Aug 6, 2022, 1:00:18 AM8/6/22
to Beancount
Of course, and thank you, Ben, and Martin! Happy to share, and more on the way :).
Reply all
Reply to author
Forward
0 new messages