I found the nice tutorial about making bones with script:
3. ArmaturesCreating keyframes for bones:
Actions and driversThis part is about making GUI in Blender using Python:
10. InterfaceThis code works in Blender 2.67 and 2.79. I think it will work in new Blendr 2.9 with little changes but I use 2.67 because it is good for my notebook.