Spline wrap animation
The object could be a simple (say) Bezier curve, with a Bevel Object (another curve) assigned to it in its Properties > Geometry panel.

The 'Tilt' property of individual control points on a Bezier curve is keyable:



So just right-click it to set keyframes appropriately.. if you want a loop, set first and last keys to be visually identical, and go into the property's f-Curve, hit T, and ensure that the interpolation between the keys is 'Linear'.