Move imported model to the center of the scene via python Can't find the way to move model to the center via Python API. When model is imported 

object.location = (0, 0, 0). 


I tried to use 

object.dimensions 


to shift model, but when model has empty spaces around - it does't work. How can I get this data or it may be a better way to do this?
If you import a model, the origin is typically at (0,0,0) - setting the location to the center has no effect. The trick is to set the geometry to the origin via origin_set operator:

bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')


Related: How to place objects on the center of the ground plane via python?