Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enricobacis/lyricwikia
Python API to get song lyrics from LyricWikia
https://github.com/enricobacis/lyricwikia
Last synced: 2 months ago
JSON representation
Python API to get song lyrics from LyricWikia
- Host: GitHub
- URL: https://github.com/enricobacis/lyricwikia
- Owner: enricobacis
- License: mit
- Created: 2016-08-07T21:21:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T16:17:27.000Z (almost 5 years ago)
- Last Synced: 2024-08-16T16:22:49.768Z (5 months ago)
- Language: Python
- Size: 25.4 KB
- Stars: 39
- Watchers: 5
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
lyricwikia
==========Python API to get song lyrics from `LyricWikia`_
.. image:: https://travis-ci.org/enricobacis/lyricwikia.svg?branch=master
:target: https://travis-ci.org/enricobacis/lyricwikiaDescription
-----------`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:
.. code::
pip install lyricwikia
Otherwise download this repository and use the ``setup.py`` file:
.. code::
python setup.py install
It is also avaliable on the AUR for Arch Linux users: `python-lyricwikia`_.
And in the `GURU overlay`_ for Gentoo Linux users as `dev-python/lyricwikia`_: ``eselect repository enable guru && emerge --sync guru && emerge 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 titleoptional arguments:
-h, --help show this help message and exit
--separator SEPARATOR
line separator
--version show program's version number and exitExample
-------.. code::
$ 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... code:: python
import lyricwikia
lyrics = lyricwikia.get_lyrics('Led Zeppelin', 'Stairway to heaven')Used by
-------- `spotify-downloader`_: download Spotify playlists with albumart and meta-tags
- `vidify`_: watch Youtube music videos (and lyrics) for the currently playing Spotify songs.. _LyricWikia: http://lyrics.wikia.com
.. _PyPI: https://pypi.python.org/pypi/lyricwikia
.. _spotify-downloader: https://github.com/ritiek/spotify-downloader
.. _python-lyricwikia: https://aur.archlinux.org/packages/python-lyricwikia/
.. _vidify: https://github.com/vidify/vidify
.. _dev-python/lyricwikia: https://gpo.zugaina.org/dev-python/lyricwikia
.. _GURU overlay: https://wiki.gentoo.org/wiki/Project:GURU