Created
October 11, 2012 05:07
-
-
Save takaki/3870297 to your computer and use it in GitHub Desktop.
simple example for parse gnucash xml by lxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from lxml import etree | |
import gzip | |
tree = etree.parse(gzip.open('personal.gnucash')) | |
root = tree.getroot() | |
for i in tree.xpath('//gnc:GncInvoice[invoice:id[text()="000003"]]',namespaces=root.nsmap): | |
print(i.tag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment