def to_positive_int(int_str):
    """
    Tries to convert `int_str` string to a positive integer number.

    Args:
        int_str (string): String representing a positive integer number.

    Returns:
        int: Positive integer number.

    Raises:
        ValueError: If `int_str` could not be converted to a positive integer.
    """

    try:
        int_int = int(int_str)
    except ValueError:
        raise ValueError("argument must represent an integer number")
    if int_int<1:
        raise ValueError("argument must be a positive integer number")
    return int_int