Updated the CLI to accept arguments in two formats: 1. Single argument with dash separator: "ARTIST - SONG" 2. Two separate arguments: ARTIST SONG This makes it more convenient for users to input artist and song information. Also updated README to document both usage formats.
Paroles.net Scraper
A Python package to fetch song lyrics from paroles.net.
Features
- Fetches song lyrics from paroles.net
- Cleans up advertisement content from lyrics
- Handles URL construction for different artists and songs
- Command-line interface for easy usage
- Comprehensive test suite
- Installable Python package
Installation
-
Clone or download this repository
-
Install the package in development mode:
pip install -e .Or if you're using uv:
uv sync
Usage
Command Line Interface
After installation, you can use the command line interface with two formats:
- Single argument with dash separator:
paroles-scraper "Artist Name - Song Title"
- Two separate arguments:
paroles-scraper "Artist Name" "Song Title"
Examples
paroles-scraper "SCORPIONS - SEND ME AN ANGEL"
paroles-scraper "Ed Sheeran" "Shape of You"
paroles-scraper "Imagine Dragons" "Believer"
As a Python Package
You can also use the package directly in your Python code:
from paroles_net_scraper import get_song_lyrics
lyrics = get_song_lyrics("Ed Sheeran", "Shape of You")
print(lyrics)
Testing
The project includes a comprehensive test suite using pytest. To run the tests:
pytest tests/ -v
Or if you're using the virtual environment:
source .venv/bin/activate
pytest tests/ -v
CI/CD
This project includes a GitLab CI configuration (.gitlab-ci.yml) that:
- Runs tests on multiple Python versions
- Builds the package using uv
- Can deploy to PyPI (when configured with credentials)
To use the GitLab CI pipeline:
- Push your code to a GitLab repository
- Ensure your GitLab runner is configured
- Set up PyPI credentials as CI/CD variables if you want to deploy
How it works
The package constructs a URL based on the artist name and song title, then scrapes the paroles.net website to extract the lyrics. It uses BeautifulSoup to parse the HTML and extract only the relevant text content while filtering out advertisements and other unwanted content.
Disclaimer
This package is for educational purposes only. Please respect the terms of service of paroles.net and use this package responsibly. Consider the legal and ethical implications of web scraping before using this tool.
Dependencies
- Python 3.7+
- requests
- beautifulsoup4
- pytest (for running tests)
- uv (for dependency management and packaging)