How can get the state information by python script in my extension

What is the correct way to get state information such as Xform position, joint speed in a script.