from typing import Tuple


def parse_fasta_header(fasta_header: str) -> Tuple[str, str, str]:
    """Parse a fasta header with the following format: db|UniqueIdentifier|EntryName.
    https://www.uniprot.org/help/fasta-headers

    Parameters
    ----------
    fasta_header : str
        A fasta header in the format: db|UniqueIdentifier|EntryName.

    Returns
    -------
    Tuple[str, str, str]
        The db, unique identifier and entry name of the fasta header.

    Raises
    ------
    ValueError
        If the fasta header doesn't follow the format: db|UniqueIdentifier|EntryName.

    """
    db, unique_identifier, entry_name = fasta_header.split("|")
    if not db or not unique_identifier or not entry_name:
        raise ValueError(
            "Invalid Fasta Header. It needs to follow the format: db|UniqueIdentifier|EntryName."
        )
    return db, unique_identifier, entry_name