Beangulp for number alignment formatting?

61 views
Skip to first unread message

Oon-Ee Ng

unread,
Feb 28, 2025, 10:38:20 AM2/28/25
to bean...@googlegroups.com
Having updated my personal importers to beangulp's import.py - I'm left with something which has been on my todo list for a while - how do I automatically align numbers in beangulp output?

Trying to achieve the equivalent of :-
python import.py extract /path/to/beancount/file | bean-format -c 100

without having to run bean-format.

Maria

unread,
Feb 28, 2025, 11:12:22 PM2/28/25
to Beancount
I've not messed with it myself, but take a look at beancount's `beancount/scripts/format.py`, The `main` function from this is what's called in bean-format. It looks like it just reads the specified file, formats it with the function `align_beancount` (also in format.py), then writes what that returns. You could apply that function to your importer's output text before writing it.
Reply all
Reply to author
Forward
0 new messages