diff --git a/pomice/spotify/artist.py b/pomice/spotify/artist.py new file mode 100644 index 0000000..baa5a5f --- /dev/null +++ b/pomice/spotify/artist.py @@ -0,0 +1,18 @@ +class Artist: + """The base class for a Spotify artist""" + + def __init__(self, data: dict, tracks: list) -> None: + self.name = f"Top tracks for {data['name']}" + self.genres = ", ".join(genre for genre in data["genres"]) + self.followers = data["followers"]["total"] + self.image = data["images"][0]["url"] + self.tracks = tracks + self.total_tracks = len(tracks) + self.id = data["id"] + self.uri = data["external_urls"]["spotify"] + + def __repr__(self) -> str: + return ( + f"" + )