Rene Luria 43a8203f70 feat: Support artist - song format in command line arguments
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.
2025-08-11 14:28:04 +02:00
2025-08-11 14:21:12 +02:00
2025-08-11 14:21:12 +02:00
2025-08-11 14:21:12 +02:00
2025-08-11 14:21:12 +02:00
2025-08-11 14:21:12 +02:00
2025-08-11 14:21:12 +02:00

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

  1. Clone or download this repository

  2. 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:

  1. Single argument with dash separator:
paroles-scraper "Artist Name - Song Title"
  1. 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:

  1. Push your code to a GitLab repository
  2. Ensure your GitLab runner is configured
  3. 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)
Description
A Python package to fetch song lyrics from paroles.net
Readme 103 KiB
2025-08-11 13:01:26 +00:00
Languages
Python 81.5%
Shell 11.7%
Makefile 6.8%