fpaupier
RapLyrics-Scraper
Python

Data sourcing and pre-processing for raplyrics.eu - A rap music lyrics generation project

Last updated Apr 23, 2026
71
Stars
14
Forks
4
Issues
0
Stars/day
Attention Score
2
Language breakdown
No language data available.
โ–ธ Files click to expand
README

PR welcome if you want to contribute to this project

RapLyrics-Scraper

CircleCI

Context

This project aims to provide high quality text dataset of rap music lyrics. Such dataset are then fed to a neural network to build lyrics-generation model. The resulting word-to-word lyrics-generative model is served on raplyrics.eu.

Feel free to tweak this scraper to fit your needs. Kudos to open source.

Setup

to be able to call their API. Once done, copy your clientaccesstoken in genius/credentials.ini.
  • Get the repo - clone from GitHub
$ git clone https://github.com/fpaupier/RapLyrics-Scraper
  • Setup a virtualenv
This project is built on python3 - I recommend using a virtual environment.
which python3 -m venv RapLyrics-Scraper
source RapLyrics-Scraper/bin/activate
pip install -r requirements.txt

Run the lyrics scraper

  • Update the list of artists you want to get the lyrics from and the number of songs
to get per artists. To do so, directly edit the artists list defined at lyrics_scraper.py:39.
  • To run the script: be sure to set the lyricsdir and songsper_artists arguments.
- Specify the directory in which the scraped lyrics should be saved with lyrics_dir - Specify the number of songs to scrap per artist with the `songsperartists arg. Run python lyrics_scraper.py --help for more information on the available arguments

Let's say you want to scrap 2 songs per artist and save them in the folder mylyricsfolder with a verbose output, run: <pre><code class="lang-bash">python lyricsscraper.py --verbose --lyricsdir=&#39;mylyricsfolder&#39; --songsperartists=2</code></pre>

  • Once the scraping is done : one lyric file is generated per artist scraped. Merge the files with:
<pre><code class="lang-bash">cat *lyrics.txt &gt; mergedlyrics.txt</code></pre>

Utils

A toolbox is also provided to analyze some of the dataset properties. To run a quick analysis of any
.txt file, update the file to consider in pre_processing/analysis.py` then run:
python pre_processing/analysis.py

Notes

Currently we get the songs by decreasing popularity order.

Related work

This project was intensively used to generate high quality text dataset that were consumed by:

- RapLyrics-Back, to train and serve a lyrics-generative model. - RapLyrics-Front consumes the model trained and served by RapLyrics-Back enabling raplyrics.eu users to generate unique and inspirational lyrics.

ยฉ 2026 GitRepoTrend ยท fpaupier/RapLyrics-Scraper ยท Updated daily from GitHub