edit bone location and rotation in world space with python

i am a new UE learner with python.

now i have a human fbx and a data file includes root location and all bone rotation in world space,

i have added the fbx into UE scene level,

Q1: so i want to use the data to edit the bone rotation and root location in world space and drive it in scene.
Q2: if Q1 is OK, then how to get all bone pose in local space with parent-child?

can you share me some main code ?
thank you!