keyframing properties problem

Hi…I am trying to animate a curve bevel_factor_end using python.
I am not able to insert keyframes…I can’t find any examples…all are with coordonates…

Simple animation method assuming two curve objects in scene, BezierCurve and BezierBevel:

import bpy

ob = bpy.context.scene.objects["BezierCurve"]
bevel = bpy.context.scene.objects["BezierBevel"]

curve =
curve.bevel_object = bevel

curve.bevel_factor_start = 0.8
curve.keyframe_insert("bevel_factor_start", frame=1)

curve.bevel_factor_start = 0.2
curve.keyframe_insert("bevel_factor_start", frame=40)


It works.
You are the best.