GnuCash Accounts XML Format




This looks good:

<?xml version="1.0" encoding="utf-8" ?>
<gnc-v2
     xmlns:gnc="http://www.gnucash.org/XML/gnc"
     xmlns:act="http://www.gnucash.org/XML/act"
     xmlns:book="http://www.gnucash.org/XML/book"
     xmlns:cd="http://www.gnucash.org/XML/cd"
     xmlns:cmdty="http://www.gnucash.org/XML/cmdty"
     xmlns:price="http://www.gnucash.org/XML/price"
     xmlns:slot="http://www.gnucash.org/XML/slot"
     xmlns:split="http://www.gnucash.org/XML/split"
     xmlns:sx="http://www.gnucash.org/XML/sx"
     xmlns:trn="http://www.gnucash.org/XML/trn"
     xmlns:ts="http://www.gnucash.org/XML/ts"
     xmlns:fs="http://www.gnucash.org/XML/fs"
     xmlns:bgt="http://www.gnucash.org/XML/bgt"
     xmlns:recurrence="http://www.gnucash.org/XML/recurrence"
     xmlns:lot="http://www.gnucash.org/XML/lot"
     xmlns:cust="http://www.gnucash.org/XML/cust"
     xmlns:job="http://www.gnucash.org/XML/job"
     xmlns:addr="http://www.gnucash.org/XML/addr"
     xmlns:owner="http://www.gnucash.org/XML/owner"
     xmlns:taxtable="http://www.gnucash.org/XML/taxtable"
     xmlns:tte="http://www.gnucash.org/XML/tte"
     xmlns:employee="http://www.gnucash.org/XML/employee"
     xmlns:order="http://www.gnucash.org/XML/order"
     xmlns:billterm="http://www.gnucash.org/XML/billterm"
     xmlns:bt-days="http://www.gnucash.org/XML/bt-days"
     xmlns:bt-prox="http://www.gnucash.org/XML/bt-prox"
     xmlns:invoice="http://www.gnucash.org/XML/invoice"
     xmlns:entry="http://www.gnucash.org/XML/entry"
     xmlns:vendor="http://www.gnucash.org/XML/vendor">
<gnc:count-data cd:type="account">2</gnc:count-data>
<gnc:commodity version="2.0.0">
  <cmdty:space>ISO4217</cmdty:space>
  <cmdty:id>USD</cmdty:id>
  <cmdty:name>US Dollar</cmdty:name>
  <cmdty:xcode>840</cmdty:xcode>
  <cmdty:fraction>100</cmdty:fraction>
  <cmdty:get_quotes/>
  <cmdty:quote_source>currency</cmdty:quote_source>
  <cmdty:quote_tz/>
</gnc:commodity>
<gnc:account version="2.0.0">
  <act:name>test</act:name>
  <act:id type="guid">99dd5b22e2ed19873f52eb6a87f31268</act:id>
  <act:type>BANK</act:type>
  <act:commodity>
    <cmdty:space>ISO4217</cmdty:space>
    <cmdty:id>USD</cmdty:id>
  </act:commodity>
  <act:commodity-scu>100</act:commodity-scu>
  <act:code>123444</act:code>
  <act:slots>
    <slot>
      <slot:key>notes</slot:key>
      <slot:value type="string">test</slot:value>
    </slot>
  </act:slots>
</gnc:account>
</gnc-v2>

<!-- Local variables: -->
<!-- mode: xml        -->
<!-- End:             -->

This is a surprisingly complicated model for a simple account, and I’m betting a lot of that info is part and parcel with the QOF system, as the format is the serialization of qof xml data, aka qsf. This looks cool:

XML::QOFQSF - convert personal data to and from QSF XML files - Support for the QOF SQLite backend will be added in a separate module in due course. NICE!

I feel like a SQL Lite back-end is the right choice for a desktop app, because the model could be shared with web apps, and other database engines, like Postgres (which I believe Gnucash is potentially supporting, or now supports), MySQL, or… you decide!

From what I can understand about QOF, it can act as a data object cache for desktop apps. I just posted a question to the GnuCash wiki about this topic, as I think it would be so cool to have a desktop application for fast access to data and highly interactive reports, as well as have “anywhere access” via a webapp like PBooks. This would be kind of like email clients and webmail.


0 Responses to “GnuCash Accounts XML Format”


  1. No Comments

Leave a Reply