Not Logged In

gnucashxml 1.0

`gnucashxml` is a [Python][] library to parse [GNU Cash][] XML files.This allows writing reporting utilities that do not rely on the GNUCash libraries themselves, or require the main program to run at all.Tested with GNU Cash 2.4.10.

The library supports extracting the account tree, including alltransactions and splits. It does not support scheduled transactions,price tables, and likely none but the most basic commodities. Inparticular, writing of XML files is not supported.

[python]: http://www.python.org/[gnu cash]: http://www.gnucash.org/

## Usage

The interface is intended to allow quickly writing reports usingPython. It reuses as many Python data structures as possible. Wheneverdates or times are used, the standard library `datetime` is used. Allaccount and transaction balances are represented as the standard`Decimal` type.

The three main concepts in GNU Cash are accounts, transactions, andsplits. A transaction consists of a number of splits that specify fromwhich account or to which account commodities are transferred by thistransaction. All splits within a transaction together are balanced.

The main classes provided by `gnucashxml` mirror these concepts. A`Book` is the main class containing everything else. A `Commodity` iswhat is stored in an account, for example, Euros or Dollars. An`Account` is part of a tree structure and contains splits. `Splits`again are part of `Transactions`.

These classes all have a `slots` member, which is a simple dictionaryfor extra information. GNU Cash information such as "hidden" arerecorded here.