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
| Name | Type | Description |
|---|---|---|
name | str | Artist or band name. |
language | str | Language code. |
media_manager | UniversalMediaManager | The API manager. |
Attributes
| Name | Type | Description |
|---|---|---|
albums | List[Dict[str, Any]] | List of albums. |
biography | str | Artist biography. |
country | Optional[str] | Artist's country of origin. |
followers | Optional[int] | |
formed_year | Optional[int] | Year the artist/band was formed. |
genres | List[str] | List of musical genres. |
members | List[str] | Band members (if applicable). |
top_tracks | List[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
| Name | Type | Description |
|---|---|---|
data | Dict[str, Any] | Artist data. |
media_manager | UniversalMediaManager | The API manager. |
Returns
ArtistArtist instance.
get_detailsasync
async def get_details() -> None:Retrieve detailed artist information.
Fills attributes: genres, country, biography, members, etc.
Sourceget_discographyasync
async def get_discography() -> List[Dict[str, Any]]:Retrieve artist's discography.
Returns
List[Dict[str, Any]]List of albums.
get_folder_structure
def get_folder_structure() -> List[str]:Return the recommended folder structure.
Returns
List[str]List containing the artist folder name.
get_formatted_name
def get_formatted_name() -> str:Return the formatted artist name.
Returns
strFormatted artist name.
get_top_tracksasync
async def get_top_tracks(limit: int = 10) -> List[Dict[str, Any]]:Retrieve artist's top tracks.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
limit | int | 10 | Maximum number of tracks to retrieve. |
Returns
List[Dict[str, Any]]List of popular tracks.
to_dict
def to_dict() -> Dict[str, Any]:Convert the artist to a dictionary.
Returns
Dict[str, Any]Artist data as dictionary.