lyrics-client


Namelyrics-client JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/Billuc/lyrics-client
SummaryA generic client to fetch lyrics from a song's data
upload_time2023-07-20 20:11:46
maintainer
docs_urlNone
authorBilluc
requires_python>=3.9,<4.0
licenseMIT
keywords lyrics client lyrics python genius azlyrics musixmatch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://python-poetry.org/) 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 :**

```python
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](https://github.com/Billuc/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 :**

```python
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](https://github.com/spotDL/spotify-downloader).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Billuc/lyrics-client",
    "name": "lyrics-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "lyrics client,lyrics,python,genius,azlyrics, musixmatch",
    "author": "Billuc",
    "author_email": "billuc@hotmail.fr",
    "download_url": "https://files.pythonhosted.org/packages/ff/ef/ad7ddda378a020d949cadde3ebe137547107ba09a25edbce054e177f75f5/lyrics_client-0.0.4.tar.gz",
    "platform": null,
    "description": "# Lyrics-Client\n\n**Get the lyrics of your favorite musics !**\n\n## Features\n\n - Automatic lyrics fetching from different services\n    - Currently supported : Genius, Musixmatch, AZLyrics\n - Title and artist verification to find the best match\n - Easy to use, straightforward interface\n - Extensive results information\n - Possible to use via DI integration\n\n## Installation\n\n### Pip\n\n```\npip install lyrics-client\n```\n\n### Poetry\n\n[Poetry](https://python-poetry.org/) is a Python dependency management and packaging tool. I actually use it for this project.\n\n```\npoetry add lyrics-client\n```\n\n## Usage\n\nThere are 2 ways to use this library : using the LyricsClient object or via the DI.\n\n### Using LyricsClient\n\nThe library exposes the LyricsClient class. This class has 2 methods : `get_lyrics` and `get_from_song`.\n\nBoth methods do the same thing : fetching lyrics and returns the results in a list of `FetchLyricsResult`.\n\nHowever, `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.\n\n**Example :**\n\n```python\nfrom lyrics_client import LyricsClient\n\nclient = LyricsClient()\nresults = client.get_from_song(\"in the end\", \"linkin park\")\n\nlyrics = results[0].lyrics\n```\n\n### Using DI\n\nThe library also exposes a `BaseLyricsClient` interface and a `add_lyrics_client` function for [Taipan-DI](https://github.com/Billuc/Taipan-DI).\n\nIn this method, the clients are registered as a Pipeline. All you need to do is to resolve the pipeline and execute it.\n\n**Example :**\n\n```python\nfrom lyrics_client import BaseLyricsClient, add_lyrics_client, FetchLyricsCommand\nfrom taipan_di import DependencyCollection\n\nservices = DependencyCollection()\nadd_lyrics_client(services)\n\nprovider = services.build()\nclient = provider.resolve(BaseLyricsClient)\nrequest = FetchLyricsCommand(\"in the end\", \"linkin park\")\n\nresults = client.exec(request)\nlyrics = results[0].lyrics\n```\n\n## Inspirations\n\nThis library is partially based on spotDL's [spotify-downloader](https://github.com/spotDL/spotify-downloader).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A generic client to fetch lyrics from a song's data",
    "version": "0.0.4",
    "project_urls": {
        "Documentation": "https://github.com/Billuc/lyrics-client",
        "Homepage": "https://github.com/Billuc/lyrics-client",
        "Repository": "https://github.com/Billuc/lyrics-client"
    },
    "split_keywords": [
        "lyrics client",
        "lyrics",
        "python",
        "genius",
        "azlyrics",
        " musixmatch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fa02ad045d2883290888c988e09a39443bc9e75337b2d85e34b0f3083e6a740",
                "md5": "e13ac4bc6eab152f0ec93584cd5f4082",
                "sha256": "91bdf2cd6985d969d5e415d632b2d7d3878bcf06be34e6fb2412c03fe733dc7d"
            },
            "downloads": -1,
            "filename": "lyrics_client-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e13ac4bc6eab152f0ec93584cd5f4082",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 12556,
            "upload_time": "2023-07-20T20:11:45",
            "upload_time_iso_8601": "2023-07-20T20:11:45.378128Z",
            "url": "https://files.pythonhosted.org/packages/6f/a0/2ad045d2883290888c988e09a39443bc9e75337b2d85e34b0f3083e6a740/lyrics_client-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffefad7ddda378a020d949cadde3ebe137547107ba09a25edbce054e177f75f5",
                "md5": "df98d0d8bfbeac5a21a8e46efffa78b8",
                "sha256": "9fe352420cc5664e3798257d250d9f76e50bee84766f9d3da3015607ef558aac"
            },
            "downloads": -1,
            "filename": "lyrics_client-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "df98d0d8bfbeac5a21a8e46efffa78b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 7941,
            "upload_time": "2023-07-20T20:11:46",
            "upload_time_iso_8601": "2023-07-20T20:11:46.754260Z",
            "url": "https://files.pythonhosted.org/packages/ff/ef/ad7ddda378a020d949cadde3ebe137547107ba09a25edbce054e177f75f5/lyrics_client-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-20 20:11:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Billuc",
    "github_project": "lyrics-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lyrics-client"
}
        
Elapsed time: 0.12122s