summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnucashxml.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnucashxml.py b/gnucashxml.py
index 2fea612..2a2599c 100644
--- a/gnucashxml.py
+++ b/gnucashxml.py
@@ -25,6 +25,7 @@ from xml.etree import ElementTree
__version__ = "1.0"
+
class Book(object):
"""
A book is the main container for GNU Cash data.
@@ -106,6 +107,11 @@ class Account(object):
yield (acc, children, acc.splits)
accounts.extend(children)
+ def find_account(self, name):
+ for account, children, splits in self.walk():
+ if account.name == name:
+ return account
+
def get_all_splits(self):
split_list = []
for account, children, splits in self.walk():