from typing import List
from typing import Dict
from typing import Any


def _write_artist_names_to_string(artists: List[Dict[str, Any]], key: str = "name", sep: str = ", ") -> str:
    """extracts the artists from the list of artists and writes them in a string separated by comma

    Args:
        artists (List[Dict[str, Any]]): the artists
        key (str): the key that shall be extracted from the list of artists. Defaults to name

    Returns:
        str: [description]
    """
    return sep.join([el[key] for el in artists])