Python Retrieve rectangle's size and vertex

Sorry for a newbie question here…

How should I retrieve a drawn rectangle (from any plane) with its width and height in Python, and also its 4 vertex’s coordinates?

(knowing I can do frame as polyline and
pt0 = frame[0]
pt1 = frame[2])

A rectangle is just a polyline with 4 segments, so just get the length of the first and second segment. Alternatively, get the distance from point 0 to point 1 and the distance from point 1 to point 2 from the control point list.