All of the molecular mechanics, optimization, and conformer searching methods in Avogadro v1.x are directly from Open Babel.
You can access these via Python:
https://open-babel.readthedocs.io/en/latest/UseTheLibrary/Python.html
Here’s an example script: