A Python application that generates word clouds from song lyrics, with special support for multilingual (Greek/English) lyrics processing. Based on the implementation of syrics-web.
- Fetch lyrics for any artist or specific album from Spotify
- Generate word clouds from song lyrics
- Language-specific processing:
- Support for both Greek and English lyrics
- Smart language detection and filtering
- Proper handling of Greek accents and diacritics
- Customizable stopwords for both languages
- Caching of lyrics data for faster subsequent runs
- Flexible output customization (size, colors, etc.)
There are two ways to install Wordify:
- Clone the repository:
git clone https://github.com/kosmasgal/wordify.git
cd wordify- Create and activate a virtual environment:
python -m venv venv
# On Windows:
.\venv\Scripts\Activate.ps1
# On Unix or MacOS:
source venv/bin/activate- Install in development mode:
pip install -e .pip install wordifyBefore using Wordify, make sure to set up your Spotify API credentials:
- Create a
.envfile in the project root - Add your Spotify API credentials:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
The main script can be run with various options:
python wordify.py "Artist Name" [options]--album "Album Name": Generate word cloud for a specific album (optional)--lang {english,greek,both}: Specify the language for word cloud generation (default: both)
Generate word cloud for all songs by an artist:
python wordify.py "Artist Name"Generate word cloud for a specific album in Greek:
python wordify.py "Artist Name" --album "Album Name" --lang greekYou can also use Wordify as a Python package in your own code:
from wordify import generate_artist_wordcloud
# Generate word cloud for all songs by an artist
generate_artist_wordcloud("Artist Name")
# Generate word cloud for a specific album in Greek
generate_artist_wordcloud("Artist Name", album_name="Album Name", language="greek")
# Generate word cloud for all songs with both languages
generate_artist_wordcloud("Artist Name", language="both")The word cloud generation can be customized by modifying parameters in generate_wordcloud.py:
- Word cloud dimensions
- Background color
- Font sizes
- Custom stopwords
This project is based on the implementation of syrics-web by akashrchandran.
- flask
- spotipy
- python-dotenv
- beautifulsoup4
- requests
- numpy
- pillow
- matplotlib
- wordcloud
- nltk
This project is licensed under the MIT License - see the LICENSE file for details.
