from pathlib import Path


def get_base_stem(path: Path) -> str:
    """Get filename from path removing all suffixes

    get_base_stem('foo/bar.warc.gz') == 'bar'
    """
    name = path.name
    suffix_len = len("".join(path.suffixes))
    return name[:-suffix_len]