Create openoffice .odt document with Python

后端 未结 3 566
天涯浪人
天涯浪人 2021-02-06 07:30

How can I create an open office .odt file from Python?

I\'m looking at this http://wiki.openoffice.org/wiki/Python, but am confused. I\'ve already got Python 2.7 so whe

3条回答
  •  生来不讨喜
    2021-02-06 08:02

    Another posibility is the odfpy module, you can see a short introduction here.

    Python API and tools to manipulate OpenDocument files

    Odfpy is a library to read and write OpenDocument v. 1.2 files. The main focus has been to prevent the programmer from creating invalid documents. It has checks that raise an exception if the programmer adds an invalid element, adds an attribute unknown to the grammar, forgets to add a required attribute or adds text to an element that doesn’t allow it.

    It's on pipy, so you can install it with

    pip install odfpy
    

提交回复
热议问题