wiki_music.external_libraries module

Warning

Documentation is stil under construction some things might not be up to date.

Here the quality of the documentation is not guaranted since we rely only on the docstrings provided by the autors of respectable packages, which are sometimes quite useless.

external_libraries.lyricsfinder

Searches lyrics.

external_libraries.lyricsfinder.extractor

Base for extracting.

class wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Bases: object

A class capable of retrieving lyrics.

classmethod can_handle(url_data: wiki_music.external_libraries.lyricsfinder.utils.UrlData) → bool

Check whether this extractor can extract lyrics from this url.

extract_lyrics(url_data: wiki_music.external_libraries.lyricsfinder.utils.UrlData, song: str, artist: str) → Lyrics

Return a Lyrics object for the given url, html or bs.

class wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractorMount(name, bases, attrs)

Bases: type

Registers new Extractors.

external_libraries.lyricsfinder.lyrics

Fancy lyrics managment.

class wiki_music.external_libraries.lyricsfinder.lyrics.LyricsManager

Bases: object

Manage stuff.

classmethod extract_lyrics(url: str, song: str, artist: str) → wiki_music.external_libraries.lyricsfinder.models.lyrics.Lyrics

Extract lyrics from url.

classmethod search_lyrics(song: str, album: str, artist: str, *, google_api_key: str) → Iterator[wiki_music.external_libraries.lyricsfinder.models.lyrics.Lyrics]

Search the net for lyrics.

classmethod setup()

Initialize class.

external_libraries.lyricsfinder.utils

Utitlities.

class wiki_music.external_libraries.lyricsfinder.utils.UrlData(url: str)

Bases: object

Url stuff.

bs

Get the BeautifulSoup object.

html

Get the html for this url.

resp

Get the requests response object.

wiki_music.external_libraries.lyricsfinder.utils.clean_lyrics(lyrics: str) → str

Perform some simple operations to clean the lyrics.

wiki_music.external_libraries.lyricsfinder.utils.safe_filename(name: str, file_ending: str = '.json') → str

Return a safe version of name + file_type.

wiki_music.external_libraries.lyricsfinder.utils.search(query: str, api_key: str) → List[T]

Return search results.

external_libraries.lyricsfinder.models

Lyric finder exceptions.

exception wiki_music.external_libraries.lyricsfinder.models.exceptions.LyricsException

Bases: Exception

exception wiki_music.external_libraries.lyricsfinder.models.exceptions.NoExtractorError(url)

Bases: wiki_music.external_libraries.lyricsfinder.models.exceptions.LyricsException

When there’s no extractor for a url.

exception wiki_music.external_libraries.lyricsfinder.models.exceptions.NoLyrics

Bases: wiki_music.external_libraries.lyricsfinder.models.exceptions.LyricsException

exception wiki_music.external_libraries.lyricsfinder.models.exceptions.NotAllowedError

Bases: wiki_music.external_libraries.lyricsfinder.models.exceptions.LyricsException

Lyrics object.

class wiki_music.external_libraries.lyricsfinder.models.lyrics.Lyrics(title: str, lyrics: str, artist: str = None, release_date: datetime.datetime = None, *, origin: wiki_music.external_libraries.lyricsfinder.models.lyrics.LyricsOrigin = None)

Bases: object

Represents lyrics for a song.

classmethod from_dict(data: Dict[str, Any])

Load from dict.

save(f: Union[str, io.TextIOBase] = None) → io.TextIOBase

Save the lyrics.

save_name

Get a possible filename.

to_dict() → LyricsDict

Convert to dict.

class wiki_music.external_libraries.lyricsfinder.models.lyrics.LyricsOrigin(url: str, source_name: str, source_url: str, *, query: str = None)

Bases: object

Represents a place where lyrics come from.

classmethod from_dict(data: Dict[str, Any]) → wiki_music.external_libraries.lyricsfinder.models.lyrics.LyricsOrigin

Load from dict.

to_dict() → OrignDict

Convert to dict.

external_libraries.lyricsfinder.extractors

Extractor for animelyrics.com.

class wiki_music.external_libraries.lyricsfinder.extractors.animelyrics.Animelyrics

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

Extractor for azlyrics.com.

class wiki_music.external_libraries.lyricsfinder.extractors.azlyrics.AZLyrics

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

Extractor for darklyrics.com.

class wiki_music.external_libraries.lyricsfinder.extractors.darklyrics.Darklyrics

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

classmethod process_lyric(lyric)

Process and format lyrics.

Extractor for genius.com.

class wiki_music.external_libraries.lyricsfinder.extractors.genius.Genius

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

Extractor for lyrical-nonsense.com.

class wiki_music.external_libraries.lyricsfinder.extractors.lyrical_nonsense.LyricalNonsense

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data: wiki_music.external_libraries.lyricsfinder.utils.UrlData, song, artist) → wiki_music.external_libraries.lyricsfinder.models.lyrics.Lyrics

Extract lyrics.

Extractor for lyricsmode.com.

class wiki_music.external_libraries.lyricsfinder.extractors.lyricsmode.Lyricsmode

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

Extractor for Musixmatch.com.

class wiki_music.external_libraries.lyricsfinder.extractors.musixmatch.MusixMatch

Bases: wiki_music.external_libraries.lyricsfinder.extractor.LyricsExtractor

Class for extracting lyrics.

classmethod extract_lyrics(url_data, song, artist)

Extract lyrics.

external_libraries.google_images_download

Module handling cover art downloades from goole image search.

Offline version of googleimages download for debugging.

class wiki_music.external_libraries.google_images_download.google_images_download_offline.GoogleImagesDownload

Bases: object

Offline version imitating google images download API.

Main puprose is offline testing.

stack

a FIFO stack that contains all the downloaded images, the limit is set to 5. Then the downloading is paused until items from the queue are consumed.

Type:queue.Queue
max

maximum number of file that are loadable from directory

Type:int
files

list of image file paths

Type:List[str]
close()

Stop downloading images.

download(arguments: dict)

Start reding images from files.

Parameters:arguments (dict) – dictionary of arguments, essentialy it is not needed. It is included only to maintain simillarity with original version API
files

List of image files to load in direstory.

See also

wiki_music.utilities.utils.list_files()
to see list of suported files
wiki_music.constants.paths.OFFLINE_DEBUG_IMAGES
directory that is searched for images
Returns:list of paths to image files
Return type:List[str]
max

Maximum number of loadable images.

Needed to set progresbar in GUI. The value is cached for later use.

See also

wiki_music.utilities.utils.list_files()
to see list of suported files
type:int

Searching and Downloading Google Images.