How to generate and read odf files with a program?

What is the best way to do this? I want to have a spreadsheet with data, and then pull that data in and create an ODT document. I’ve already looked at reports, and they seem hopelessly inadequate to what I want to do, so instead what I’d like to do is write, say, a Python program that reads my spreadsheet and then writes a text document according to formatting and style rules that I code up. I have seen some musings about something called UNO, but it’s all a few years old and looks to be for OOo, not LOo, and it might do more than I need; I don’t need to interact with the LOo program itself at all. I also know that ODF documents are just XML under the hood, but I don’t really know what to do with that information.

Searching the net for “python odf spreadsheet”, some links:

Thanks, ezodf looks like exactly what I was looking for! I guess I could do with some better googling skills.