Cast a string to a strictly positive integer.

def positive_int(integer_string: str, strict: bool = False, cutoff: Optional[int] = None) -> int:
    """
    Cast a string to a strictly positive integer.
    """
    ret = int(integer_string)
    if ret < 0 or (ret == 0 and strict):
        raise ValueError()
    if cutoff:
        ret = min(ret, cutoff)
    return ret