from io import StringIO
import gzip


def gunzip_to_ram(gzip_file_path: str) -> StringIO:
    """
    gunzip a gzip file and decode it to a io.StringIO object.
    """
    content = []
    with gzip.open(gzip_file_path, "rb") as f:
        for line in f:
            content.append(line.decode("utf-8"))

    temp_fp = StringIO("".join(content))
    return temp_fp