Every now and then someone posts a question about the animation of models, created with Qubicle. A popular way is to use Blender, as it is open source and you can find tons of tutorials, examples and guides.
Some time ago I wanted to create animations for an Indie Game called Stonehearth and I've started to play around with Blender. What I've recognized very fast was that Blender allows you to create scripts which you can use to automate repeating activities, using Python as a language. This is something which can be very useful if you are going to create e.g. many animations of similar models for a project.
I want to share the attached Add-On as an example of what you can do with Blender and maybe also as an inspiration or starting point to dig into scripting / coding for Blender. You can find additional documentation and guides related to this Add-On in the official forum of Stonehearth. The Add-On is probably more powerful than I would create it for a private project, as Stonehearth uses JSON as a file-format, so I've included an exporting-feature which saves the animations in that proprietary format. However, you can see how to use "template files" to automate creation of relationships between bones, how to modify parameters, etc.
All code is under the GPL license, so feel free to re-use or adjust. I've also added some comments to explain the more interesting code-elements.