lyricsgenius
provides a simple interface to the song, artist, and lyrics data stored on Genius.com.
isitclean
utilizes lyricsgenius
to quickly find "clean" songs by a specific artist or album.
Before using this package you'll need to sign up for a (free) account that authorizes access to the Genius API. The Genius account provides a client_access_token
that is required by the package. See the Usage section below for examples.
By default, isitclean imports a config file with a variable named client_access_token. Create your own config.py and store your unique client access token from Genius there.
lyricsgenius
requires Python 3.
Use pip
to install the package from PyPI:
NOT YET IMPLEMENTED
pip install isitclean
Or, clone the latest version of the package from GitHub:
git clone https://github.com/orioncrocker/isitclean
Search for song with arguments 'song' and 'artist'
python3 -m isitclean song "Feed The Horses" "Thank You Scientist"
Search for an artist, by default most popular songs will be fetched
python3 -m isitclean artist "Smashing Pumpkins"
Search for ten songs by 'Protest The Hero'
python3 -m isitclean artist "Protest The Hero" --max-songs 10
Import the package and search for songs by a given artist:
import isitclean
genius = lyricsgenius.Genius("my_client_access_token_here")
artist = genius.search_artist("Andy Shauf", max_songs=3, sort="title")
print(artist.songs)
Search for a single song by the same artist:
song = genius.search_song("To You", artist.name)
print(song.lyrics)
Add the song to the artist object:
artist.add_song(song)
Save the artist's songs to a JSON file:
artist.save_lyrics()
There are various options configurable as parameters within the Genius
class:
genius.clean = False # Doesn't print if songs have profanities or not
genius.verbose = False # Turn off status messages
genius.remove_section_headers = True # Remove section headers (e.g. [Chorus]) from lyrics when searching
genius.skip_non_songs = False # Include hits thought to be non-songs (e.g. track lists)
genius.excluded_terms = ["(Remix)", "(Live)"] # Exclude songs with these words in their title
Search by album rather than limited to just song or artist search
python3 -m isitclean album "Float" "Aesop Rock"
- Trucks and Beer: A textual analysis of popular country music
- Neural machine translation: Explaining the Meaning Behind Lyrics
- What makes some blink-182 songs more popular than others?
- Sentiment analysis on hip-hop lyrics
- Does Country Music Drink More Than Other Genres?
- 49 Years of Lyrics: Why So Angry?