Get Blender X,Y,Z and Bounding Box with script
To include parenting and drivers, use this for the actual object location / origin:

ob = bpy.context.object

ob.matrix_world.translation # or .to_translation()



You can get the bounding box corners Object.bound_box in object-space and multiply by Object.matrix_world for world-space:

from mathutils import Vector
bbox_corners = [ob.matrix_world * Vector(corner) for corner in ob.bound_box]
# bbox_corners = [ob.matrix_world @ Vector(corner) for corner in ob.bound_box]  # Use this in V2.80+


Note that the bounding box is not axis aligned.