Is there a way to rotate armatures by name or index in code rather than using a long series of nodes which can be a lot of work?

Anyway like the title says if my project gets an error that disables me from editing it I have to set up nodes all over again. I have tried to migrate this so that I would have it, but that did not work.