Skip to content

Aidanpgh/Anki-thing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spanish Lyrics Anki Generator

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.

Prerequisites

  • Python 3.10+
  • A free Genius API token

Getting a Genius API Token

  1. Go to https://genius.com/api-clients
  2. Sign up or log in
  3. Click Create an API Client
  4. Fill in the app name (anything you like) and app website URL (can be http://localhost)
  5. Click Generate Access Token
  6. Copy the token

Setup

# 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 token

Running

python app.py

Open http://localhost:5000 in your browser.

Usage

  1. Type a Spanish song name (e.g. "Despacito")
  2. Optionally add the artist name for more accurate results
  3. Click Generate Cards
  4. Wait for lyrics to be fetched and translated
  5. Click Download .apkg
  6. Double-click the downloaded file to import it into Anki

How It Works

  • Lyrics: Fetched from Genius via the lyricsgenius library
  • 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

Project Structure

Anki creator/
├── app.py              # Flask backend
├── index.html          # Frontend UI
├── requirements.txt    # Python dependencies
├── .env.example        # Template for API key config
└── README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors