This converts a hierarchy made of empties to an armature with bones. Bones are constrained to empties, then the resulting animation can be baked (search for NLA bake function in the F3 search menu). Mainly a proof of concept as of now, may be improved later.
Download the .py file and install it in Blender. Select the empties and click Create Armature in the Tool tab.