from song_generator import song_generator
The song generator downloads the lyrics for the artist, caches them, and initializes the Markov Chain by loading the lyrics. The download may take a few minutes.
sheeran = song_generator('Ed Sheeran')
new_sheeran_hit = sheeran.make_song()
new_sheeran_hit.title
print(new_sheeran_hit.lyrics)
When loading a generator for the artist again, even in a later session, it loads from the cache, so it goes way faster. (No download is necessary.)
another_sheeran = song_generator('Ed Sheeran')
mars = song_generator('Bruno Mars')
Passing save=True
to make_song
or make_album
saves to a new-lyrics
folder in the project directory.
new_mars_album = mars.make_album(save=True)
new_mars_album.title
[song.title for song in new_mars_album.songs]
print(new_mars_album.songs[2].lyrics)