Adding armatures

So i want to animate a flower…just a test right now i was thing of using armatures and i want to do this all via python, so could someone point me in the right direction of how to do this? Meaning how would i add the armatures in the right places… Here is a screen shot of the flower…

Please any help is appreciated, also if this isn’t the best technique please let me know what is, and i am really trying to avoid doing it by hand because i want o learn how to code fairly complex animations, also i think it will be easier to adjust the animation after im done

have a look at (comes with blender) - it creates armatures for motion capture files.

Thanks. I’ll give it a look.

Another one is Truman’s add sappling addon. It has an option to add an armature to the created tree. You may even be able to fudge around until you create a branch structure that matches your flower.