I attempt to center the view on the currently selected object using Python. Normally, you would select the object and then press Numpad . in the viewport.
According to the keymap, the command behind it is view3d.view_selected
or more accurate bpy.ops.view3d.view_selected
:
The documentation says basically nothing about how to use it.