How to animate Constraints with Python? I have a cube

cube = bpy.data.objects['Cube']


The cube has a constraint, follow path. I would like to animate the offset in this constraint. I do know how to edit the value of it, but i need to put in a keyframe. Is there something like:

cube.keyframe_insert(data_path='offset_constraint', frame=10)
Right click on the property and select copy data path and use it :

in this case it's constraints["Follow Path"].offset

and the adding a keyframe would be like :

cube.keyframe_insert(data_path='constraints["Follow Path"].offset', frame=10)