How do I change the name of an Armature using Python?
bpy.data.armatures[&quot;Armature.001&quot;].name = &quot;Armature&quot; should do the trick, but keep in mind that the &quot;.001&quot; was added because of an existing data-block that already had the name &quot;Armature&quot;.
If the command is executed and the original data-block with the name &quot;Armature&quot; still exists, then that one will get the suffix so that the names are still unique.