Skip to main content

Library to extract song lyrics from www.animelyrics.com

Project description

animelyrics

Build Status Coverage Status Code style: black made-with-python MIT license

Python API to retrieve song lyrics from animelyrics.

Features

  • Search for lyrics from animelyrics website
  • Japanese (romaji) and english translated text support
  • Show title on top of lyrics

Prerequisties

  • Python >=3.0.0

Install

pip install animelyrics

Simple! 🎉

Usage

import animelyrics

print(animelyrics.search_lyrics("renai circulation"))

Multi-language search

The language of the lyrics can be specified using the lang argument during the function call:

import animelyrics

print(animelyrics.search_lyrics("god knows", lang="en"))

Currently the API only supports the following inputs

  • jp - romaji text
  • en - translated english text

Song Titles

To add the song title and the anime where it came from to the lyrics, use the show_title argument

import animelyrics

print(animelyrics.search_lyrics("snow halation", show_title=True))

Exceptions

The API contains the following exception that will be raised in different scenarios

  • InvalidLanguage
  • MissingTranslatedLyrics
  • NoLyricsFound

The following example shows how to cover all exceptions while searching for lyrics:

import animelyrics

try:
    lyrics = animelyrics.search_lyrics("song lyrics")
except animelyrics.MissingTranslatedLyrics:
    # case when english language is used but no translation is found
except animelyrics.NoLyricsFound:
    # case when no lyrics are found

Test

python setup.py test

Author

🕺 Melvin Yeo

🤝 Contributing

Contributions, issues, and feature requests are welcome!"
Check out the issues page

Support

Please ⭐ this repository if it is helpful to you!

License

Copyright © 2019 Melvin Yeo.
This project is MIT licensed.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

animelyrics-0.1.0-py2.py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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