GAHTO is a small Python module for creating GNUCash Account Hierarchy Template
Objects natively in python, and eventually exporting them in XML as
.gnucash-xea files.
from gahto.gahto import GAHTO
from gahto.gahto import GATO
from gahto.gahto import AccountType
EL = GAHTO("Title")
EL.set_description("Short description", "Longer description")
expenses_acct = GATO("Expenses", AccountType.Expense)
expenses_acct.set_description("Expenses")
expenses_acct.set_placeholder(True)
EL.add_account(expenses_acct)
childcare_acct = GATO("Childcare", AccountType.Expense)
childcare_acct.set_description("Childcare")
expenses_acct.add_subaccount(childcare_acct)
EL.export("example-account-hierarchy.gnucash-xea")With python-coverage and
pytest installed, run:
$ python3-coverage run -m pytest
$ python3-coverage html
$ xdg-open htmlcov/index.htmlAlternatively, you can replace the last two commands with:
$ python3-coverage report