Scripting support for any programming language is implemented in LibreOffice and OpenOffice using respective UNO (Universal Network Objects) bridges. This means that other supported languages, including python, must negotiate a UNO bridge.
This comment from Dan Dascalescu offers a challenge to the community:
OOO Development Tools (OooDev) offers a python framework for the community to take another step to change this. The starting point is Java LibreOffice Programming which we thank Andrew Davison for kindly making available provided his work is acknowledged.
The website the Java code was originally found on is no longer available. WayBack Machine - Java LibreOffice Programming still has a copy of the website for now. An archive of the Java code is available at https://github.com/Amourspirit/libreoffice_lop_java. The origin book by Andrew Davison can be found in the LibreOffice Programming that was converted by flywire.
Changes required are reformatting for this media since the scripts have missed a lot of detail including code, generalizing the content so it is more widely applicable to supported languages and complementing Python examples with examples of other language. Please contribute where you can.
:Barry-Thomas-Paul: Moss, Andrew Davison