LibreOfficeScriptInsert.py inserts a python script (Macro) into a LibreOffice Calc document.
Tested with LibreOffice 5.2, at least.
$ python LibreOfficeScriptInsert.py myDocument.ods myScript.py
A copy of myDocument.ods will created, with the script myScript.py embedded in it, and with name myDocument.with_script.ods
For example, the script FIFOStockSellProfitCalculator.py that calculates FIFO profits, can be inserted into any of your .ods Calc documents for portability and ease of use, with:
$ python LibreOfficeScriptInsert.py myStocks.ods FIFOStockSellProfitCalculator.py
The Calc document with the Macro script embedded will be named myStocks.with_script.ods
Licensed as GPL v3 or higher.