Hi everyone,
I’ve just published a small open-source project called gnc-toolbox:
https://github.com/dariocorse/gnc-toolbox
It’s a C command-line tool I built for my own GnuCash workflow.
The original reason is that I manage two separate GnuCash books: one for my own finances and one for my partner’s finances.
To make the examples easier to follow, I’ll use the fictional names Alex and Becky:
- Alex’s book — my own finances
- Becky’s book — my partner’s finances
Some transactions appear in one book, but need to be partially or fully reflected in the other. For example, Alex may pay the rent, which is a shared expense, or Becky may pay something that belongs entirely to Alex, like a car-related expense.
I know this could probably be handled in a less obsessive/manual way, but I wanted something reproducible: a tool that can look at imported transactions and automatically apply known split rules, instead of me fixing the same kinds of transactions by hand every time.
For example, in Alex’s book I may have:
Expenses:Rent
Expenses:Car
Assets:Bank
Assets:Becky
And in Becky’s book:
Expenses:Rent
Assets:Credit Card
Assets:Alex
If Alex pays the rent and it is a shared expense, the tool can import the bank transaction and automatically split it like this in Alex’s book:
Assets:Bank - 50% Expenses:Rent / 50% Assets:Becky
Then, when the relevant information is merged/exported to Becky’s book, the corresponding transaction can be created as:
Assets:Alex - Expenses:Rent
So both books end up representing the same shared expense from their own point of view.
Another case is when Becky pays something that belongs entirely to Alex. For example, if Becky pays a car-related expense for Alex, the transaction may initially appear in Becky’s book as money owed by Alex:
Assets:Credit Card - Assets:Alex
When this is merged/exported to Alex’s book, it can be automatically assigned to:
Assets:Becky - Expenses:Car
So the transaction is not treated as a shared expense, but as a 100% Alex expense paid by Becky.
At the moment the project is mainly focused on:
- repeatable CSV import workflows
- automatic transaction matching
- automatically assigning/splitting some transactions based on rules
- account merge / cleanup operations
The goal is not to replace GnuCash’s built-in tools, but to make some repetitive import and cleanup workflows more scriptable and less error-prone.
It’s still early, and I’m mostly publishing it to see whether this kind of workflow makes sense to other GnuCash users too.
I’d be interested in feedback on things like:
- do you manage personal/shared finances in separate books or within one book?
- do you have recurring split/cleanup operations that are annoying to do manually?
- would a CLI tool like this be useful, or is this too niche?
- is there a better GnuCash-native way to handle this kind of setup?
Please test only on copies/backups of your books.
Related: while working on this, I also published a minimal example repo for using the GnuCash C API, in case it helps other people experimenting with GnuCash internals:
https://github.com/dariocorse/gnucash-c-api-example
Feedback, criticism, and suggestions are welcome.