A local web app that turns Spanish song lyrics into Anki flashcard decks for language learning. Type a song name, and it fetches the lyrics, translates each line to English, and builds a downloadable .apkg file.
- Python 3.10+
- A free Genius API token
- Go to https://genius.com/api-clients
- Sign up or log in
- Click Create an API Client
- Fill in the app name (anything you like) and app website URL (can be
http://localhost) - Click Generate Access Token
- Copy the token
# Clone or download this folder, then:
cd "Anki creator"
# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure your API key
cp .env.example .env
# Edit .env and paste your Genius API tokenpython app.pyOpen http://localhost:5000 in your browser.
- Type a Spanish song name (e.g. "Despacito")
- Optionally add the artist name for more accurate results
- Click Generate Cards
- Wait for lyrics to be fetched and translated
- Click Download .apkg
- Double-click the downloaded file to import it into Anki
- Lyrics: Fetched from Genius via the
lyricsgeniuslibrary - Cleaning: Section headers like
[Verse 1]are stripped, duplicate lines are removed, and short lines (< 4 words) are merged with the next line - Translation: Each line is translated from Spanish to English using Google Translate via
deep-translator - Cards: Built with
genanki— the front shows the Spanish lyric with a song/artist hint, the back shows the English translation - Tags: Every card is tagged with the song title and artist name for easy filtering in Anki's browser
Anki creator/
├── app.py # Flask backend
├── index.html # Frontend UI
├── requirements.txt # Python dependencies
├── .env.example # Template for API key config
└── README.md