Check if a property is animated or has a driver
A keyframe check could be done like this:

import bpy

def has_keyframe(ob, attr):
    anim = ob.animation_data
    if anim is not None and anim.action is not None:
        for fcu in anim.action.fcurves:
            if fcu.data_path == attr:
                return len(fcu.keyframe_points) &gt; 0
    return False

print(has_keyframe(bpy.context.object, "location"))


But don't think there is an easy way to test for drivers.