Skip to main content

A generic client to fetch lyrics from a song's data

Project description

Lyrics-Client

Get the lyrics of your favorite musics !

Features

  • Automatic lyrics fetching from different services
    • Currently supported : Genius, Musixmatch, AZLyrics
  • Title and artist verification to find the best match
  • Easy to use, straightforward interface
  • Extensive results information
  • Possible to use via DI integration

Installation

Pip

pip install lyrics-client

Poetry

Poetry is a Python dependency management and packaging tool. I actually use it for this project.

poetry add lyrics-client

Usage

There are 2 ways to use this library : using the LyricsClient object or via the DI.

Using LyricsClient

The library exposes the LyricsClient class. This class has 2 methods : get_lyrics and get_from_song.

Both methods do the same thing : fetching lyrics and returns the results in a list of FetchLyricsResult.

However, get_lyrics accept a FetchLyricsCommand object as parameter, while get_from_song accept a song title, the song artists and optionally the clients to use.

Example :

from lyrics_client import LyricsClient

client = LyricsClient()
results = client.get_from_song("in the end", "linkin park")

lyrics = results[0].lyrics

Using DI

The library also exposes a BaseLyricsClient interface and a add_lyrics_client function for Taipan-DI.

In this method, the clients are registered as a Pipeline. All you need to do is to resolve the pipeline and execute it.

Example :

from lyrics_client import BaseLyricsClient, add_lyrics_client, FetchLyricsCommand
from taipan_di import DependencyCollection

services = DependencyCollection()
add_lyrics_client(services)

provider = services.build()
client = provider.resolve(BaseLyricsClient)
request = FetchLyricsCommand("in the end", "linkin park")

results = client.exec(request)
lyrics = results[0].lyrics

Inspirations

This library is partially based on spotDL's spotify-downloader.

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

lyrics_client-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

lyrics_client-0.0.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file lyrics_client-0.0.3.tar.gz.

File metadata

  • Download URL: lyrics_client-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1040-azure

File hashes

Hashes for lyrics_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f07e197eb02278b4a2d2f8d1f721f9671bf73ae7bc7a00faf24ce04292168236
MD5 c43cd13919c279db8eac30ca3d566a2f
BLAKE2b-256 2469289fa0567b42e3e5cda712b5915b49c5360b05fcf6de33e6152a25e7c3f8

See more details on using hashes here.

File details

Details for the file lyrics_client-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: lyrics_client-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1040-azure

File hashes

Hashes for lyrics_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7fc623888f13d00bbeb958f0f90d6268af18c810fefb66eabf57548710e51aaf
MD5 c0ce298ba6bfeb8d1da8e41eb53dc60b
BLAKE2b-256 117bb5332f97f768812d4aad4ab7f5a7c5020aafb746a0703ab88f984f13018b

See more details on using hashes here.

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