Coder Social home page Coder Social logo

edwardseley / lyrics-corpora Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 1.0 70 KB

An unofficial Python API that allows users to create a corpus of lyrical text from their favorite artists and billboard charts

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
billboard-charts lyrics artists corpus python-api music scrapper scraping-websites python songs

lyrics-corpora's Introduction

Lyrics Corpora

This Python API allows users to create a corpus of lyrical data from their favorite artist, genre, or billboard charts. This API differentiates itself from others similar to it by retrieving lyrics from songs and artists through searches (thereby allowing variation in name) and by allowing users to get collections of music from genres and billboard charts instead of just individual songs or artist discographies.

Install

pip install lyricscorpora

Command Line Interface

(C:\Users\seley\Anaconda3) C:\Users\seley>lyricscorpora --help                                                          
usage: lyricscorpora [-h HELP] [-a ARTIST] [-t TITLE] [-g GENRE] [-gl GENRELIST] [-b BILLBOARDCHART]                                                                                                                                                                          
Get lyrics from your favorite songs, artists, genres, and billboard charts!

optional arguments:                                                                                                       
-h, --help                          Show this help message and exit                                                                   
-a ARTIST, --artist ARTIST          Specify the artist's name                                                                         
-t TITLE, --title TITLE             Specify the song's title                                                                          
-g GENRE, --genre GENRE             Specify the genre of lyrics you would like to receive                                             
-gl, --genrelist                    Returns a list of the available genres to pull from                                    
-b BILLBOARDCHART                   Specify the number of weeks for the billboard charts  

Usage

Getting module

import lyricscorpora as lc

Getting lyrics from a song

song = lc.Song("The Weeknd", "Wicked Games")
lc.get_lyrics(song)
[out]: I left my girl back home...

Getting artist info

artist = lc.Artist("Drake")
albumList = artist.get_album_list()
print(albumList)
[out]: "Room for Improvement (2006)", "Comeback Season (2007)", ... "Scary Hours (2018)"
album = albumList[6]
print(album)
[out]: "Scary Hours (2018)"
songList = album.get_song_list()
print(songList)
[out]: "God's Plan", "Diplomatic Immunity"
song = songList[1]
song.get_lyrics()
[out]: "Yeah they wishin' and wishin' and wishin' and wishin'..."

Getting artist corpus

artist = lc.Artist("Drake")
artist.get_lyrics() #gets the lyrics to every song from every album by the artist
[out]: "You see the difference between me and you..."

Getting lyrics from Billboard charts

billboardChart = lc.Billboard(52) #Gets song information from every song on the charts for the past 52 weeks
songList = billboardChart.get_song_list()
print(songList)
[out]: "Havana, Perfect, Rockstar, .."
song = songList[0]
print(song.get_lyrics)
[out]: "Havana, ooh na-na (ay)"
artist = song.get_artist()
print("Camila Cabello")

Getting lyrics by genre

GENRE_LIST = ["r-b-hip-hop", "country", "rock", "latin", "dance-electronic", "christian", "gospel"]
...
genre = lc.Genre("r-b-hip-hop") #Gets the songs for the genre's top 50 songs for the past 2 years (must be from GENRE_LIST) 
genre.get_artist_list()
[out]: "Bruno Mars & Cardi B", "Miguel", "Chris Brown"...
genre.get_song_list()
[out]: "Finesse (remix)", "Skywalker", "Pills & Automobiles"...

License

This project is licensed under the MIT License - see the LICENSE.md file for details

lyrics-corpora's People

Contributors

edwardseley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ejmurra

lyrics-corpora's Issues

None type issue

capture

I get this error with the test code you provide in the read me :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.