from pathlib import Path


def read_single_line(fpath, lineno):
    """
    Read a single line from a given path
    """
    if not isinstance(lineno, int):
        raise ValueError(
            "When reading a single line from file, lineno should be a number"
        )

    if not Path(fpath).exists():
        raise FileExistsError(
            "When reading a single line from file: the file doesnt exist!"
        )

    with open(fpath, "r") as f:
        for i, line in enumerate(f):
            if i == lineno:
                return line