I have several odt files, and I would like to merge them into a new one.
I am using relatorio library to read the odt files.
from relatorio.templates.opendocument import Template
from os.path import dirname, join
odt_1 = Template(source='', filepath='report_test_1_fulled.odt')
odt_2 = Template(source='', filepath='report_test_2_fulled.odt')
In order to merge them into one I have tried two options without success:
- Use Aspose library to convert them to .docx and then do the merge. But when installing the library
pip install aspose-wordsI get this error:
ERROR: Could not find a version that satisfies the requirement aspose-words (from versions: none)
ERROR: No matching distribution found for aspose-words
I think that this might be because my computer operative system is macOS Catalina, and this does not fullfil the requirements.
- Merge both odt files, but I cannot figure out how.
¿Any suggestion? The final goal is to end up with one .odt or .docx containing both.
To combine two documents using Aspose.Words you can use Document.append_document method.
You can learn more about appending and inserting documents here: https://docs.aspose.com/words/python-net/insert-and-append-documents/
PS: You are right, currently Aspose.Words for Python does not support MacOS.