-
Hi! Thank you for this great package. I've tried a few simple searches and am looking in the documentation, but I can't seem to find a method to get the albums for a specific artist based on the list of songs returned. I'm seeing that although the Artist object has a song attribute, the Song object doesn't have an album attribute. However when I dump the Song object into json I do see album info in there. Is there a reason for this? Or am I simply missing something obvious? I'm trying to build a dataset for lyrics of an artist where album may be a good feature to have. Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hi. To get an Artist's albums you can use the albums = genius.artist_albums(45)['albums']
for album in albums:
full_album = genius.search_album(album_id=album['id'], get_full_info=True) As for why some attributes are present in the dict, but not in the object, it's because of consistency. Depending on the value of the |
Beta Was this translation helpful? Give feedback.
Hi. To get an Artist's albums you can use the
Genius.artist_albums
method and then get more information from there:As for why some attributes are present in the dict, but not in the object, it's because of consistency. Depending on the value of the
get_full_info
parameter there will be more or fewer data in the response, but LyricsGenius has to make sure that the values are consistent, so some of them have been removed from the object (but still available throughto_dict
if you want them). We'll probably change this in the future to provide all p…