Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Fetch the currently playing song from Spotify and display the lyrics in terminal or a browser tab. Very fast.

Project description


Build Status Build Status PyPI GitHub closed issues Downloads

Fetches the currently playing song from Spotify on Windows, Linux and macOS and displays the lyrics in the command-line or in a browser tab. Refreshes automatically when song changes. The lyrics are fetched from Genius. Turns out Deezer already has this feature in-built but with swaglyrics, you can have it in Spotify as well.

I'm mainly trying to build this project as far as I can, for practice and to learn and work with more technologies and platforms.

Initially developed this for personal use. Pretty much functionality oriented -- I usually develop something that I can see helping me and other users in the same situation. Packaged so I can first hand handle production-ready code to an extent and to make distribution and usage easier.

Why SwagLyrics?

SwagLyrics is THE fastest and the most accurate package for getting lyrics.1

Provided optimal internet, SwagLyrics can fetch lyrics for a track in as less as 0.28s.2

It also does not require the user to generate any sort of API token (Spotify or Genius) and serves functionality right off the bat. This is possible as the song identification is done using our in-house library SwSpotify which does it locally for all operating systems.

The enhanced user experience is possible due to the backend which manages creating issues for unsupported songs and then adding support for them where possible by employing various techniques. Any song with lyrics on Genius can be supported without any user interaction owing to the backend. If say, lyrics do not exist for a track then subsequent playings of that track will not waste your resources in trying to fetch lyrics, this is done by a master list of unsupported songs which is handled by the backend as well.

1. <small>[results]</small> Tested against LyricsGenius, the most popular similar package on the US Top 50 Chart on Spotify. SwagLyrics was fractionally more accurate and 2.4x times faster.
2. <small>[results]</small> Speed and accuracy benchmark using Google Colab on the Spotify US Top 50 chart.


Requires Python 3.6+. Use pip or pip3 depending on your installation. You might want to use the --user flag on Linux to avoid using pip as root.

pip install swaglyrics


usage: swaglyrics [-h] [-t] [-c] [-n]

Either the tab or cli argument is required to output lyrics.


  -h, --help      show this help message and exit       
  -t, --tab       Display lyrics in a browser tab.      
  -c, --cli       Display lyrics in the command-line.   
  -n, --no-issue  Disable issue-making on cli.

You can quit by pressing Ctrl+C.

Before using, you should check USING.txt to comply with the Genius ToS. There's a copy included inside the package as well.



  • v1.0.1

    • Refactor to fix #1682
    • Add type annotations to
    • Bump code coverage to 90%
    • Fully mock backend API calls in unit tests
    • Add integration tests

See for prior release notes.

Compiling SwagLyrics for Development

  • Clone the repo by git clone or use ssh.
  • cd into the cloned repo.
  • pip install -e . the -e flag installs it locally in editable mode.

Improvements Planned

  1. Linux and macOS support done
  2. Better logging of unsupported songs, the isolated unsupported.txt is sub-optimal for multiple users since the file will only update locally with songs which worked fine when it was just me but since I hope others use it too, I'll try to add a better method with server support.
  3. Better tests to test all of the functionality. ( fully tested!)
  4. Perhaps a tiny app using Electron that could fit in your tray to be opened whenever you want lyrics for a song.
  5. Supporting more songs, currently the program sometimes fails at remixes since while the lyrics are same as original, the artist is the remixer. done
  6. Documenting all the files.

SwagLyrics on Windows with Terminal

SwagLyrics with Hyper

SwagLyrics on Windows with Firefox Side-View

SwagLyrics with Side-View

Screencast - SwagLyrics on Linux

Watch the video

Screencast - SwagLyrics on macOS

Watch the video

Project details

Download files

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

Files for swaglyrics, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size swaglyrics-1.1.0-py3-none-any.whl (15.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size swaglyrics-1.1.0.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page