how to bake Sun Position into Sun object animation
Simpler than I thought:
sun = bpy.data.objects[&quot;Sun&quot;]
sun.select_set(True)
bpy.ops.nla.bake( frame_start=1, frame_end=10, bake_types={'OBJECT'} )