- 活発にメンテナンスされています (ですが、あまりリリースはありません)
- 最終リリース: 2020-01-18
- サンプル: https://github.com/eea/odfpy/tree/master/examples
- not specifically provided for merging but may do so, examples could be provided
- 最終リリース: 2015-03-13
- 最終リリース: 2019-10-06
Third party project, actively maintained. The main developer (Franck Lefevre) had contacted the French-speaking community of LibreOffice through his Twitter account in order to ask questions to an ODF guru. Contacting Svante Schubert, working for CIB, was recommended to him.
- PhpPresentation, PhpProject & PhpVisio
- 最終リリース: 2019-12-02
Active project, plugin for TinyButStrong but usable without TinyButStrong. Very easy to use, no installation, only two php files containing the classes are needed. Based on user-defined templates.
- active maintenance
- last release: 2019-06-17
- https://github.com/webodf/WebODF https://webodf.org/
- last release: 2015-09-04
- last update: 2019-02-08
- active maintenance (although few releases)
- last update: 2020-01-02
- no examples
- not specifically provided for merging but may do so
- used by Libriciel for WEBDELIB (generation of deliberations for local governments)
- active maintenance
- last release: 2019-09-05
- documentation: https://github.com/NDCODF/ndcodfapi_service/blob/master/Developer_Guide.md
- The documentation is not fully translated into English.
It is also possible to generate ODF documents running LibreOffice on a server. A LibreOffice process will be able to execute a macro which will itself generate one or more documents, for example via a merge. To call a macro on a Linux server for execution without a GUI :
libreoffice --nofirststartwizard --norestore --headless --invisible "macro:///bibliothèque.module.macro(arg1,arg2...)"
Generic method, based on standard Python packages
The ODF standard consists in making a compressed file (by ZIP), which contains various data, most of them in XML format. There is no reason why a generic tool for handling XML should be discarded. Of course, this assumes that the person writing a script knows what XML is, what trees, subtrees, nodes, attributes, etc. are. A good way to work is to start from a template file, which already contains the constant parts of the document to be generated, with the right styles, and a suitable structure, and then create a lightweight script next to it that retrieves data from elsewhere, and uses the DOM tree of the template to generate an elaborate document. Thus, one easily separates the form (in the template) from the content (the data processing).
The Python zipfile package allows you to open .odt, .ods, .odg, etc. files and to access their contents, in particular the content.xml file that encodes the content of the document, the Pictures directory that contains the images, etc.
With the minidom class, it is easy to open the content.xml file and analyze its contents in the form of a syntax tree (the DOM tree). When you have this tree, you can find a particular branch, delete it, or modify it, or make copies of it and graft them to the tree before or after another branch.