Hacker News new | ask | show | jobs
by mszcz 626 days ago
I tried it years ago but finally settled on HLedger. Like GnuCash, I own and control my data, but with HLedger I have an ability to go in and correct or change something (and not in a "accounting-appropriate" way) in bulk just by editing it in Sublime Text. Then again, my use case is pretty basic and not mission critical so YMMV.
7 comments

This is absolutely a valid reason to not use GnuCash.

As for myself, I agree that the XML format is not great, but I use the SQLite format, which allows me to write scripts on it.

You can write scripts to transform XML documents as well.
True, but I don't want to. And that is the biggest barrier of all.
I was going to say what GP said, but, yeah, XSLT is just no fun to write by comparison to SQL.
Hardly anybody was using XSLT even when XML was all the rage. Python scripts work just fine.
XSLT 1 was very limited. XSLT 2 was too late. That's my take. I actually like XSLT 2, but it's so verbose... -- it's horrible.

Once in a while I dream of adding proper XML support to jq just to be able to use jq as a pithy alternative to XSLT.

XQuery is easier and can be fun to use!
I use Firefly III (https://firefly-iii.org). It's a self-hosted web app which is nice for me because I tend to use it from my phone most of the time. It does have a pretty extensive API, perhaps not as easy to do bulk edits as a text file, but should be fairly straightforward. It also has a rule system that could be used to do bulk edits too.
I'm using GnuCash and not being able to easily do bulk changes or easily script it is quite annoying, for example after a slight mistake in a CSV import.
GnuCash has a scripting engine. If you have to do a specific correction very often, it might be worth it to implement something. If possible, the CSV should be preprocessed of course.

If nothing else works, a Gnucash file is XML. A bit annoying to work with, but quite possible.

Can you share a link to the docs for the scripting engine? I've seen conflicting information over the years and I'm not sure what the latest really is.
The other person said GnuCash has a scripting engine. These are just scripts. Not the same thing.
These are examine scripts for a REST API that gives access to internals of GnuCash.
It's one piece in one of the puzzles, but it's not really what I'm looking for.
Internally, it uses Guile. I'm afraid there might not be a good user interface to edit the Guile source files, but at least Guile is much more pleasant to work with than C and offers way less paper cuts. I think it's mostly used for reports. You might have to create a plugin to expose your own scripts in the UI.
I feel like it could do with some tutorials and guides on Guile. I would have liked to be able to do reporting and invoicing with more control through scripts, but last time I looked at it I just gave up due to lack of docs.
Yeah, at some point I got the impression that I could use Guile to extend it, but then couldn't find any way to do it as an end user. Not sure if I was just wrong, or out of date.
And since the CSV importer is terrible there are always a lot of edits to do unfortunately.
Exactly. I can try out stupid stuff, but because it's all text files and no magic, reverting back is as easy as it gets.
I have also used hledger and ledger (specifically the lots feature) for many years. One nice feature of hledger is its csv rules system, which is very flexible. I extended it with simple python scripts to add extra information for registering capital gains. So, end of the day the raw input data is just some csv files with records and the output is financial reports with various levels of detail.
I actually run a little script that converts the gnucash xml to ledger[0] and keep that (and the original xml) tracked in git. Run that fairly regularly while entering into gnucash ui and I have an easily readable git log/diff of my changes. But it's missing the "bulk change" ability, yes. (The gnucash is just xml so one could edit that, I haven't dared to yet.)

[0] based on https://gist.github.com/nonducor/ddc97e787810d52d067206a592a...

It's xml right.

Whenever I have to edit an xml file I tend to just go ham with python's xml library. the scripts are never pretty, mainly because they are whatever addhoc editing I wanted in written form. The hardest part is figuring out the xpath syntax.

A slight lie, I use lxml, mainly because it can select siblings which the built in xml lib is unable to do. but I still use the internal libs documentation, mainly because it is easier to read.

Yeah, I've never found XML to be easy to edit/bulk edit/edit by hand. I suppose there are tools that would allow me to do that but since I would use them sporadically, I'd need to re-learn them every use. At the same ^D/^KD in Sublime works just fine.
I like that I can version control the GNUCash XML file, and edit it by hand when needed while still having a GUI for entry.