You may want to look into JSR223, it is a Jython interface to write python-like rules and seemingly tap into the power of python (disclaimer: I am just a reader of the forum here). There is some documentation available https://www.openhab.org/docs/configuration/jsr223-jython.html#jsr223-jython-scripting, however, you may want to search the forum as this is an area under development and the docs are lacking behind as far as I understand.
this here: [JSR223-Jython] Simplified rule definition (similar to Rules DSL) and universal decorator and here: Jython scripting examples using lucid, an openHAB 2.x jsr223 Jython helper library may help you further.