I don't know anything about coding... but right-clicking on the Size value under Viewport Display and choosing "Copy Data Path" tells me the value is called display_size. Maybe this helps; I don't know how to address this in python. Anyway, from this value you can calculate the viewport camera dimensions according to these rules (if the camera scale is set to 1):
The Size value you set for the Viewport Display is the width of the displayed camera, the height is according to the render size aspect ratio.
So if the render size is 1920 x 1080 for example (i.e. 16:9), and the camera size is set to 2 meters, then the height is 2m x 9/16 = 1.125 m.
The "length" of the camera is the Viewport Display Size multiplied by the ratio between Sensor Size and Focal Length.
With a camera size set to 2 meters, let's say the Focal Length is 50mm and the Sensor Size is the default 36mm, then the displayed camera length is 2m x 50/36 = 2.777...m.
EDIT, just for completion: The Shift X and Shift Y values are the factor how much of the width size the camera is shifted to the right (X, left if negative) and upwards (Y, downwards if negative) from the camera origin along its length.
So, with the previous example values this means, if you set Shift X = 1 and Shift Y = 0.5, the 2m x 1.125m frame is 2.7778m away from the origin position and shifted 2m x 1 = 2m to the right and 2m x 0.5 = 1m upwards.
I've uploaded a file where a plane is parented to the camera and drivers positioning it to the camera frame so you can see the dependencies.