decode_rational
decode_rational(data: Any)An int for a whole number, otherwise a Fraction.
>>> decode_rational("2/4")
Traceback (most recent call last):
...
openmusickit.errors.OmkJsonError: '2/4' is not a rational in lowest terms; write '1/2'.Raises
| Name | Type | Description |
|---|---|---|
| OmkJsonError | for anything but an integer or an "n/d" string in lowest terms with d > 1. |