code: def match_to_dict(match):
      
      balance, indent, account_fragment = match.group(1, 2, 3)
      return {
          'balance': decimal.Decimal(balance),
          'indent': len(indent),
          'account_fragment': account_fragment,
          'parent': None,
          'children': [],
      }
docs: Convert a match object into a dict.
  
      Values are:
          indent: amount of indentation of this [sub]account
          parent: the parent dict (None)
          account_fragment: account name fragment
          balance: decimal.Decimal balance
          children: sub-accounts ([])