Skip to content

sok.media.music.artist

Artist class for music artists.

Artist

class Artist(name: str, language: str, media_manager: UniversalMediaManager)

Bases: BaseMedia

Class for managing music artists.

Represents a music artist or band with metadata and discography.

Initialize an Artist instance.

Parameters

NameTypeDescription
namestrArtist or band name.
languagestrLanguage code.
media_managerUniversalMediaManagerThe API manager.
Source

Attributes

NameTypeDescription
albumsList[Dict[str, Any]]

List of albums.

biographystr

Artist biography.

countryOptional[str]

Artist's country of origin.

followersOptional[int]
formed_yearOptional[int]

Year the artist/band was formed.

genresList[str]

List of musical genres.

membersList[str]

Band members (if applicable).

top_tracksList[Dict[str, Any]]

List of popular tracks.

from_dictclassmethod

def from_dict(
data: Dict[str, Any],
media_manager: UniversalMediaManager,
) -> Artist:

Create an Artist instance from a dictionary.

Parameters

NameTypeDescription
dataDict[str, Any]Artist data.
media_managerUniversalMediaManagerThe API manager.

Returns

Source

get_detailsasync

async def get_details() -> None:

Retrieve detailed artist information.

Fills attributes: genres, country, biography, members, etc.

Source

get_discographyasync

async def get_discography() -> List[Dict[str, Any]]:

Retrieve artist's discography.

Returns

  • List[Dict[str, Any]]List of albums.
Source

get_folder_structure

def get_folder_structure() -> List[str]:

Return the recommended folder structure.

Returns

  • List[str]List containing the artist folder name.
Source

get_formatted_name

def get_formatted_name() -> str:

Return the formatted artist name.

Returns

  • strFormatted artist name.
Source

get_top_tracksasync

async def get_top_tracks(limit: int = 10) -> List[Dict[str, Any]]:

Retrieve artist's top tracks.

Parameters

NameTypeDefaultDescription
limitint10Maximum number of tracks to retrieve.

Returns

  • List[Dict[str, Any]]List of popular tracks.
Source

to_dict

def to_dict() -> Dict[str, Any]:

Convert the artist to a dictionary.

Returns

  • Dict[str, Any]Artist data as dictionary.
Source
Built with Kiln