from pathlib import Path


def relative_path(path):
    """Convert input to Path; ensure that it's relative and within the repo
    """

    path = Path(path)
    if path.is_absolute():
        raise ValueError(f'absolute path: {path}')
    if '..' in path.parts:
        raise ValueError(f'parent directories not allowed: {path}')
    return path