How to find order type i.e BUY or SELL of an already executed position using its ticket id?

 
Im mainly using python.