How do you get an object's position and rotation through script?
You can access an object's transformations through the relevant properties (location, rotation_euler -  for Euler XYZ rotations, and scale) this way:

&gt;&gt;&gt; object.location
Vector((-2.609607696533203, -3.618044137954712, 1.8581657409667969))

&gt;&gt;&gt; object.rotation_euler
Euler((-0.6668576598167419, 0.697817325592041, -1.8853096961975098), 'XYZ')

&gt;&gt;&gt; object.scale
Vector((1.2768771648406982, 1.4246054887771606, 0.6418209075927734))


Do note though that these values represent the object origin. If your origin is not at the center of your object, you might get unexpected location values.

Move the origin to the geometry (Ctrl+Alt+Shift+C > Origin to Geometry) first on all your objects to avoid this.

Or pythonically:

bpy.ops.object.select_all( action = 'SELECT' )
bpy.ops.object.origin_set( type = 'ORIGIN_GEOMETRY' )


On a more general note though, I'd like to mention some great sources for documentation and examples for Blender python scripting that will help you find answers more quickly next time (since finding object location and other transformations is probably one of the most basic and best documented things you can do in scripting, I'm assuming you're not familiar with these sources):

Blender API official documentation (with useful search bar)

Scripting quickstart document

Blender python scripting Code Snippets and Cookbook