Skip to content
Python API to get song lyrics from LyricWikia
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lyricwikia bump to version 0.1.9 Jan 10, 2018
scripts
tests remove print from test Jan 10, 2018
.gitignore
.travis.yml
LICENSE add LICENSE Aug 8, 2016
Makefile add Makefile Jan 10, 2018
README.rst
setup.cfg add tests using pytest Jan 10, 2018
setup.py url encode artist and song (fixes #1) Jan 10, 2018

README.rst

lyricwikia

Python API to get song lyrics from LyricWikia

https://travis-ci.org/enricobacis/lyricwikia.svg?branch=master

Description

LyricWikia is an online wiki-based lyrics database and encyclopedia. It used to provide full access to song lyrics via API, but the service has been discontinued.

This API scrapes the song web page and returns the lyrics. Please verify that your use complies with the LyricWikia terms of service.

Installation

The package lyricwikia is on PyPI, so you can install it using pip:

pip install lyricwikia

Otherwise download this repository and use the setup.py file:

python setup.py install

Usage

You can use the lyrics command to look for a song lyrics.

usage: lyrics [-h] [--separator SEPARATOR] [--version] ARTIST SONG

Get lyrics of a song from LyricWikia

positional arguments:
ARTIST Artist name SONG Song title
optional arguments:
-h, --help show this help message and exit
--separator SEPARATOR
 line separator
--version show program's version number and exit

Example

$ lyrics 'Led Zeppelin' 'Stairway to heaven'
There's a lady who's sure all that glitters is gold
...

API

At the moment lyricwikia provides two APIs that are not officially already provided by the official APIs):

  • get_lyrics(artist, song, linesep='\n', timeout=None): returns a string
    that contains the lyrics of the song as provided by LyricWikia. If the lyrics is not found, the LyricsNotFound exception is raised.
  • get_all_lyrics(artist, song, linesep='\n', timeout=None): returns a list of all the lyrics versions of the song (e.g., both the kanji and the romaji versions if available). If the lyrics is not found, the LyricsNotFound exception is raised.
import lyricwikia
lyrics = lyricwikia.get_lyrics('Led Zeppelin', 'Stairway to heaven')

Used by

You can’t perform that action at this time.