Looped animated object

I have an animated object in a separate .blend file. How can I append it to another scene so that the animation of this object in a new scene loops when the scene render duration exceeeds the animation length of an object.

Example: animated rotated cube in a separate file with 10 frames. I want to add it to a scene where I’m gonna render 100 frames and I want the cube animation to be looped.

In fact, I really need to make it from python, but that can wait a bit.

I usually just go to the dope sheet editor and copy the keys and duplicate them and then copy those and duplicate it tell I have it as long as I need it.

I’d render out the ten frames, and just import them into the Video Sequence Editor, and duplicate the strips 9 more times. Save some render time.

Problem solved. What I was looking for is an f-curve cycles modifier.