Really unsure this is what is wanted in the question, but:

There is no Python nor animation nodes here. This is simply an animation.
The torus is done from a base little cylinder with an array and a simple deform to curve it:

Then animate an empty with a circle curve surrounding the torus:

And make this last empty parent of the torus.
Et voila:

All that is due to the simple deform which considers the object origin as base. As the parenting changes this origin location, it gives the result.
The curve is here to ensure that the result will be like 'around a sphere'.
