from pathlib import Path


def get_output_filename(output_folder: str, repository_type: str,
                        repository_name: str, filename: str) -> Path:
    """Returns the output filename for the file fetched from a repository."""
    return (
        Path(output_folder) / Path(repository_type.lower())
        / Path(Path(repository_name).name) / Path(Path(filename).name)
    )