{"id":17602471,"url":"https://github.com/johnwmillr/lyricsgenius","last_synced_at":"2025-05-14T00:07:17.538Z","repository":{"id":39987204,"uuid":"96547310","full_name":"johnwmillr/LyricsGenius","owner":"johnwmillr","description":"Download song lyrics and metadata from Genius.com 🎶🎤","archived":false,"fork":false,"pushed_at":"2025-04-23T06:17:10.000Z","size":1234,"stargazers_count":976,"open_issues_count":27,"forks_count":176,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-11T04:32:22.275Z","etag":null,"topics":["download-lyrics","genius-api","genius-lyrics","lyrics","python","scraping-lyrics","song-lyrics"],"latest_commit_sha":null,"homepage":"http://www.johnwmillr.com/scraping-genius-lyrics/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnwmillr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"johnwmillr"}},"created_at":"2017-07-07T14:36:42.000Z","updated_at":"2025-05-09T12:53:22.000Z","dependencies_parsed_at":"2024-11-06T05:32:39.411Z","dependency_job_id":"48d08520-f457-49e5-9e03-39c5a66520d2","html_url":"https://github.com/johnwmillr/LyricsGenius","commit_stats":{"total_commits":402,"total_committers":28,"mean_commits":"14.357142857142858","dds":0.4626865671641791,"last_synced_commit":"ee6c7fbb826dcbd99d5a75c49fde3a55bee43014"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwmillr%2FLyricsGenius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwmillr%2FLyricsGenius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwmillr%2FLyricsGenius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwmillr%2FLyricsGenius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnwmillr","download_url":"https://codeload.github.com/johnwmillr/LyricsGenius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043730,"owners_count":22005005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["download-lyrics","genius-api","genius-lyrics","lyrics","python","scraping-lyrics","song-lyrics"],"created_at":"2024-10-22T13:08:28.599Z","updated_at":"2025-05-14T00:07:17.528Z","avatar_url":"https://github.com/johnwmillr.png","language":"Python","readme":"# LyricsGenius: a Python client for the Genius.com API\n[![Build Status](https://github.com/johnwmillr/LyricsGenius/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/johnwmillr/LyricsGenius/actions/workflows/build.yml)\n[![Documentation Status](https://readthedocs.org/projects/lyricsgenius/badge/?version=master)](https://lyricsgenius.readthedocs.io/en/latest/?badge=master)\n[![PyPI version](https://badge.fury.io/py/lyricsgenius.svg)](https://pypi.org/project/lyricsgenius/)\n[![Support this project](https://img.shields.io/badge/Support%20this%20project-grey.svg?logo=github%20sponsors)](https://github.com/sponsors/johnwmillr)\n\n`lyricsgenius` provides a simple interface to the song, artist, and lyrics data stored on [Genius.com](https://www.genius.com).\n\nThe full documentation for `lyricsgenius` is available online at [Read the Docs](https://lyricsgenius.readthedocs.io/en/master/).\n\n## Setup\nBefore using this package you'll need to sign up for a (free) account that authorizes access to [the Genius API](http://genius.com/api-clients). The Genius account provides a `access_token` that is required by the package. See the [Usage section](https://github.com/johnwmillr/LyricsGenius#usage) below for examples.\n\n## Installation\n`lyricsgenius` requires Python 3.\n\nUse `pip` to install the package from PyPI:\n\n```bash\npip install lyricsgenius\n```\n\nOr, install the latest version of the package from GitHub:\n\n```bash\npip install git+https://github.com/johnwmillr/LyricsGenius.git\n```\n\n## Usage\nImport the package and initiate Genius:\n\n```python\nimport lyricsgenius\ngenius = lyricsgenius.Genius(token)\n```\n\nIf you don't pass a token to the `Genius` class, `lyricsgenus` will look for an environment variable called `GENIUS_ACCESS_TOKEN` and attempt to use that for authentication.\n\n```python\ngenius = Genius()\n```\n\nSearch for songs by a given artist:\n\n```python\nartist = genius.search_artist(\"Andy Shauf\", max_songs=3, sort=\"title\")\nprint(artist.songs)\n```\nBy default, the `search_artist()` only returns songs where the given artist is the primary artist.\nHowever, there may be instances where it is desirable to get all of the songs that the artist appears on.\nYou can do this by setting the `include_features` argument to `True`.\n\n```python\nartist = genius.search_artist(\"Andy Shauf\", max_songs=3, sort=\"title\", include_features=True)\nprint(artist.songs)\n```\n\nSearch for a single song by the same artist:\n\n```python\nsong = artist.song(\"To You\")\n# or:\n# song = genius.search_song(\"To You\", artist.name)\nprint(song.lyrics)\n```\n\nAdd the song to the artist object:\n\n```python\nartist.add_song(song)\n# the Artist object also accepts song names:\n# artist.add_song(\"To You\")\n```\n\nSave the artist's songs to a JSON file:\n\n```python\nartist.save_lyrics()\n```\n\nSearching for an album and saving it:\n\n```python\nalbum = genius.search_album(\"The Party\", \"Andy Shauf\")\nalbum.save_lyrics()\n```\n\nThere are various options configurable as parameters within the `Genius` class:\n\n```python\ngenius.verbose = False # Turn off status messages\ngenius.remove_section_headers = True # Remove section headers (e.g. [Chorus]) from lyrics when searching\ngenius.skip_non_songs = False # Include hits thought to be non-songs (e.g. track lists)\ngenius.excluded_terms = [\"(Remix)\", \"(Live)\"] # Exclude songs with these words in their title\n```\n\nYou can also call the package from the command line:\n\n```bash\nexport GENIUS_ACCESS_TOKEN=\"my_access_token_here\"\npython -m lyricsgenius --help\n\n# Print a song's lyrics to stdout in text format\npython -m lyricsgenius song \"Check the Rhyme\" \"A Tribe Called Quest\" --format txt\n\n# Save a song's lyrics in JSON format\npython -m lyricsgenius song \"Begin Again\" \"Andy Shauf\" --format json --save\n\n# Save a song's lyrics in both JSON and text formats\npython -m lyricsgenius song \"Begin Again\" \"Andy Shauf\" --format json txt --save\n\n# Save an artist's lyrics to text files (stopping after 2 songs)\npython -m lyricsgenius artist \"The Beatles\" --max-songs 2 --format txt --save\n```\n\n## Example projects\n\n  - [Trucks and Beer: A textual analysis of popular country music](http://www.johnwmillr.com/trucks-and-beer/)\n  - [Neural machine translation: Explaining the Meaning Behind Lyrics](https://github.com/tsandefer/dsi_capstone_3)\n  - [What makes some blink-182 songs more popular than others?](http://jdaytn.com/posts/download-blink-182-data/)\n  - [Sentiment analysis on hip-hop lyrics](https://github.com/Hugo-Nattagh/2017-Hip-Hop)\n  - [Does Country Music Drink More Than Other Genres?](https://towardsdatascience.com/does-country-music-drink-more-than-other-genres-a21db901940b)\n  - [49 Years of Lyrics: Why So Angry?](https://towardsdatascience.com/49-years-of-lyrics-why-so-angry-1adf0a3fa2b4)\n\n## Contributing\nPlease contribute! If you want to fix a bug, suggest improvements, or add new features to the project, just [open an issue](https://github.com/johnwmillr/LyricsGenius/issues) or send me a pull request.\n","funding_links":["https://github.com/sponsors/johnwmillr"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwmillr%2Flyricsgenius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnwmillr%2Flyricsgenius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwmillr%2Flyricsgenius/lists"}