python-uno часто используется для управления OpenOffice / LibreOffice. Однако, если вы просто хотите создавать отчеты в файлах odt или pdf, вы можете использовать PyQt4
Простой пример, показывающий, как записать в файл odt:
>>>from pyqt4 import QtGui
# Create a document object
>>>doc = QtGui.QTextDocument()
# Create a cursor pointing to the beginning of the document
>>>cursor = QtGui.QTextCursor(doc)
# Insert some text
>>>cursor.insertText('Hello world')
# Create a writer to save the document
>>>writer = QtGui.QTextDocumentWriter()
>>>writer.supportedDocumentFormats()
[PyQt4.QtCore.QByteArray(b'HTML'), PyQt4.QtCore.QByteArray(b'ODF'), PyQt4.QtCore.QByteArray(b'plaintext')]
>>>odf_format = writer.supportedDocumentFormats()[1]
>>>writer.setFormat(odf_format)
>>>writer.setFileName('hello_world.odt')
>>>writer.write(doc) # Return True if successful
True
QTextCursor также может вставлять таблицы, кадры, блоки, изображения. Дополнительная информация. Больше информации на:
http://qt -project.org / док / кварта-4,8 / qtextcursor.html