Calculate integer and decimal aspect ratio for dimensions.
$ whratio 1024 768
4 3 1.3333333333333333
$ whratio -d -n 2 256 196
1.31
whratio -WH 2560 1080 | tr " " :
64:27
>>> import whratio
>>> whratio.as_int(1920, 1080)
(16, 9)
>>> whratio.as_float(1920, 1080)
1.7777777777777777
>>> round(whratio.as_float(1920, 1080), 2)
1.78
Using pip:
# pip3 install whratio