Bone orientation data

Can I use python to get it I want bone rotation data. Can I get it and how?
edit:I get rotation data but I don’t know how quaternion work can someone explain?