Skip to main content

LyricWikia API for song lyrics

Project description

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

It is also avaliable on the AUR for Arch Linux users: python-lyricwikia

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lyricwikia-0.1.10.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file lyricwikia-0.1.10.tar.gz.

File metadata

  • Download URL: lyricwikia-0.1.10.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/2.7.15

File hashes

Hashes for lyricwikia-0.1.10.tar.gz
Algorithm Hash digest
SHA256 364ae5139e1ca65a887141ee6755bf5a783daa5f7391e6a46b23e04a254bc7a2
MD5 40cd5b1e245edf131433d31ad990785b
BLAKE2b-256 db51a40c5ff006605674530ec7fc582681b4da5ceddebe4f10bb5e8e78198592

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page