from pathlib import Path


def get_filename(file_path: str) -> str:
    """Extract the name of the file from a file path and exclude any file extension"""
    if not file_path:
        raise ValueError("Invalid file/folder path")
    # Replace any backslash(es) in Windows file path with forwardslash(es)
    file_path = file_path.replace("\\", "/")
    return Path(file_path).stem.split(".")[0]