This can certainly be done (well, assuming your release of Pyrosetta has the loops namespace wrapped). The question is how complicated is it. If you’re asking for a script that will do it, I don’t think there is one. I can offer advice on writing the script. Which did you want?