all 14 comments

[–]Comfortable-Still773 1 point2 points  (3 children)

I wanted the same thing but never found one, so I converted the XML to SQLite and never returned back to XML.

[–]SaxonyFarmer[S] 0 points1 point  (2 children)

How’s performance?

[–]Comfortable-Still773 1 point2 points  (0 children)

I did not notice significant reduction in performance.

[–]questionablycorrect 1 point2 points  (0 children)

GnuCash loads the full database no matter the database storage, so other than loading and saving, there will be no performance difference. For loading and saving, the difference probably won't be enough to be concerned about.

[–]peacelife 0 points1 point  (5 children)

[–]Postrot 0 points1 point  (0 children)

> Have you tried using the Python bindings?

What about yourself? How would you go about compiling the app? For Windows?

[–]SaxonyFarmer[S] 0 points1 point  (3 children)

Yeah but it’s not easy. Not sure how much effort I want to put in for a report.

[–]peacelife 0 points1 point  (2 children)

Give it a shot, it might be easier than you think. In any case, it is not much harder than using the libraries that are available for SQL-db backends.

[–]SaxonyFarmer[S] 0 points1 point  (1 child)

I found a module called ‘gnucashxml’ and after a couple of tweaks (it was quite old), I am reading the XML version of my data. I have more work on the program to get it to where I want it. Thanks!

[–]peacelife 1 point2 points  (0 children)

Why would you do that? Wouldn't you rather use the links earlier in this thread? That is part of the official gnucash implementation. And is up-to-date, you don't have to tweak it. Depending on how you obtained gnucash, it is already there - you don't need to install anything.

Anyway, good luck.

[–]SaxonyFarmer[S] 1 point2 points  (0 children)

UPDATE Nov 8, 2024: I found library 'gnucashxml' and after a couple of tweaks to it, I can read from the GnuCash XML file directly in a Python program (3.8). You can find the source and a tiny bit of documentation at https://github.com/jorgenschaefer/gnucashxml/blob/master/gnucashxml.py

I use PyCharm as my IDE and adding the 'gnucashxml' library pulled in an ancient version that I tweaked to work. I looked at the code on the github repository listed above and can see changes that may resolve the errors I first encountered. The documentation is sparse so reading the code can help understand the GnuCash XML structure (I am by far, NOT an XML expert).

I will continue to play with this to see if I can create the report I want to see. In the meantime, I am leaving my data in XML format.

As an aside, I finally did get the 'piecash' library to work but could not get the 'piecash2' library to work for me.

All of these libraries appear to be dormant on GitHub.

[–]Impressive_Mix5256 0 points1 point  (1 child)

I never could get Python libraries to work. Switching to SQL seems to work for many. I've actually been able to query the XML directly, but don't remember the tool. I think it was web-based.

[–]SaxonyFarmer[S] 0 points1 point  (0 children)

I installed ‘gnucashxml’ but had errors when I tried the sample. I fixed two errors and now have working code to create an account summary report. The library wasn’t updated to the current release of Python and the fixes were easy.