All Projects → brenns10 → Tswift

brenns10 / Tswift

Licence: bsd-3-clause
MetroLyrics API for Python

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Tswift

Lyrics King React Native
Lyrics King is React Native song lyrics search app, built with Expo. Designed with Adobe XD.
Stars: ✭ 261 (+383.33%)
Mutual labels:  lyrics
Musicrepair
Fixes music metadata and adds album art.
Stars: ✭ 566 (+948.15%)
Mutual labels:  lyrics
Lyrics Corpora
An unofficial Python API that allows users to create a corpus of lyrical text from their favorite artists and billboard charts
Stars: ✭ 13 (-75.93%)
Mutual labels:  lyrics
React Music Player
🎵 Maybe the best beautiful HTML5 responsive player component for react :)
Stars: ✭ 321 (+494.44%)
Mutual labels:  lyrics
Lyricsgenius
Download song lyrics and metadata from Genius.com 🎶🎤
Stars: ✭ 529 (+879.63%)
Mutual labels:  lyrics
Lyricviewdemo
LyricView is a powerful and flexible custom view to display lyrics within music player under Android
Stars: ✭ 647 (+1098.15%)
Mutual labels:  lyrics
MrPlayer
This is Mp3 Player made on python
Stars: ✭ 23 (-57.41%)
Mutual labels:  lyrics
Spotify Lyrics
Shows lyrics from the song you're playing in Spotify.
Stars: ✭ 40 (-25.93%)
Mutual labels:  lyrics
Cplayer
A beautiful and clean WEB Music Player by HTML5.
Stars: ✭ 556 (+929.63%)
Mutual labels:  lyrics
Vanilla Music Lyrics Search
Vanilla Music player Lyrics Search plugin
Stars: ✭ 11 (-79.63%)
Mutual labels:  lyrics
Lrc Maker
歌词滚动姬|可能是你所能见到的最好用的歌词制作工具
Stars: ✭ 329 (+509.26%)
Mutual labels:  lyrics
Quicklyric
Android app that instantly fetches your lyrics for you.
Stars: ✭ 413 (+664.81%)
Mutual labels:  lyrics
Alltomp3 App
Download and Convert YouTube, SoundCloud & Spotify in MP3 with full tags (title, artist, genre, cover, lyrics 🔥)
Stars: ✭ 920 (+1603.7%)
Mutual labels:  lyrics
Bopscrk
Tool to generate smart and powerful wordlists
Stars: ✭ 273 (+405.56%)
Mutual labels:  lyrics
Rapping Neural Network
Rap song writing recurrent neural network trained on Kanye West's entire discography
Stars: ✭ 951 (+1661.11%)
Mutual labels:  lyrics
spotify-lyrics-cli
Migrated to Gitlab, this Github repo will not receive updates.
Stars: ✭ 57 (+5.56%)
Mutual labels:  lyrics
Lyricfier
a Spotify Lyrics alternative app | New updates at https://github.com/emilioastarita/lyricfier2 (a faster version in golang)
Stars: ✭ 598 (+1007.41%)
Mutual labels:  lyrics
Lyrics Crawler
Get the lyrics for the song currently playing on Spotify
Stars: ✭ 49 (-9.26%)
Mutual labels:  lyrics
Alignmentduration
Lyrics-to-audio-alignement system. Based on Machine Learning Algorithms: Hidden Markov Models with Viterbi forced alignment. The alignment is explicitly aware of durations of musical notes. The phonetic model are classified with MLP Deep Neural Network.
Stars: ✭ 36 (-33.33%)
Mutual labels:  lyrics
Mprislyrics
Small command-line utility that displays lyrics in sync with the currently playing song in a MPRIS2 capable player.
Stars: ✭ 24 (-55.56%)
Mutual labels:  lyrics

tswift

This repo is actually not directly related to Taylor Swift. It's just a simple Python API for getting lyrics from MetroLyrics. Here is how easy it is:

.. code:: python

from tswift import Artist
import random

tswift = Artist('Taylor Swift')
song = random.choice(tswift.songs)
print(song.format())

Setup

This package depends on lxml, requests, and google. These should be installed when you install this package from pip:

.. code::

pip install tswift

After installing, you can also print a random Taylor Swift song lyric with the command:

.. code::

tswift

CLI

The module comes with a simple command line interface. By default, it will display a random song by Taylor Swift. You can specify an artist like this:

.. code::

tswift 'Lynyrd Skynyrd'

You can choose a particular song:

.. code::

tswift 'Lynyrd Skynyrd' -s Freebird

There is also a "lyric search mode", which allows you to search for a song by lyrics, e.g.:

.. code::

tswift -l 'I would walk 500 miles'

Im Gonna Be 500 Miles
Proclaimers
---------------------

When I wake up, well I know I'm gonna be,
I'm gonna be the man who wakes up next you
...

API

Artist class


The constructor takes a single argument, the artist name. This name will be "slugified" in order to use it within URLs. This process involves replacing spaces with hyphens, and making everything lowercase. If this is not sufficient for your particular artist, you'll need to provide a pre-slugified version of their name.

  • songs - a list of Song instances by this artist. This will call load() if it hasn't been called yet
  • name - the artist's slugified name
  • load() - populates the songs list

Song class


The constructor can be called in two ways. In the first, you provide a Metrolyrics URL, and the class will infer the artist and song title:

.. code:: python

s = Song(url='url here')

In the second way, you provide a title and artist, which will be slugified.

.. code:: python

s = Song('Taylor Swift', 'Love Story')

The attributes are:

  • lyrics - a string. Accessing this will call load() if not yet loaded
  • title - de-slugified title of song
  • artist - de-slugified artist name
  • load() - loads the lyrics
  • format() - returns the lyrics, with a header that includes the title and artist.

The static method Song.find_song(lyrics) takes a string with a search term, and performs a Google search. It returns a Song instance corresponding to the first Metrolyrics link it finds, stopping after 20 results. If nothing is found, returns None.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].