import gzip


def compress_file(src_file: str) -> str:
    """
    Compress file to save space.

    :return: compressed file name
    """
    compressed_file = f"{src_file}.gz"
    with open(src_file, "rb") as f_in:
        with gzip.open(compressed_file, "wb") as f_out:
            for line in f_in:
                f_out.write(line)
    return compressed_file