Communication with from python computer vision program for wrist three rotational orientation

I am looking to create a program that uses the UR3 bot to pick up a cylinder shaped object. The object will be moved and must be placed in the same rotational orientation every time. My plan is to have a mounted camera above where the robot picks that finds the part’s current rotational orientation and have wrist 3 rotate so that it can pick up the part in the correct orientation for placement. Is it possible to have the python program tell the robot how many degrees it needs to turn the wrist or will i have to use the i/o input to manually rotate the wrist until it reaches the desired alignment.