An interactive command-line flashcard application built with Python and Rich for studying programming concepts, with support for custom flashcard sets and progress tracking.
- 📚 Multiple flashcard sets with custom titles and emojis
- 🎯 Study modes: sequential or randomized
- 📊 Comprehensive statistics tracking per set and globally
- 💻 Syntax-highlighted code examples
- 🎨 Beautiful Rich-based terminal UI with 80-character width panels
- 📝 Support for YAML flashcard format
- 🔄 Automatic flashcard set discovery
- Clone or download this repository
- Create a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Run the application without arguments to see all available flashcard sets:
python main.pyThis will show a menu where you can:
- Select a flashcard set by number
- Press
sto view statistics for all sets - Press
qto quit
You can also run a specific flashcard set directly:
python main.py flashcard_sets/python_basic_flashcards.yaml
python main.py flashcard_sets/git_basics_flashcards.yamlOnce you select a flashcard set, you can choose:
- Study all flashcards - Go through cards in order
- Study random flashcards - Randomized order
- View statistics - See your progress on this set
- Exit - Return to main menu
- Read the question and think about the answer
- Press Enter to reveal the answer
- Indicate if you got it right:
y(yes) orn(no) - Press
sto skip to session summary - Press
qto quit back to menu
The application comes with several pre-made flashcard sets:
- 🐍 Python Basics - Fundamental Python concepts
- 🚀 Python Advanced - Advanced Python topics
- ⭐ JavaScript Basics - Essential JavaScript concepts
- 🔥 JavaScript Advanced - Complex JavaScript topics
- 🗄️ PostgreSQL Basics - SQL and database fundamentals
- 🔧 Git Basics - Version control with Git
- 📚 Programming Terminology - General programming concepts
Create YAML files in the flashcard_sets/ directory:
title: "My Custom Set"
icon: "🎯"
flashcards:
- question: "What is your question?"
answer: "This is the answer explanation."
code_example: |
# Optional code example
print("Hello, World!")
- question: "Another question?"
answer: "Another answer."
# code_example is optional- Place files in
flashcard_sets/directory - Use
.yamlor.ymlextensions - Files are automatically discovered and displayed in the menu
- Add a
titlefield with descriptive text for your flashcard set - Add an optional
iconfield with an emoji to display alongside the title - If no title is provided, the filename will be used (formatted)
- Icons help visually distinguish different subject areas
A YAML schema is provided in flashcard_schema.yaml that defines the structure and validation rules for flashcard files. You can use tools like yamllint to check your flashcard files against this schema.
The app tracks detailed statistics including:
- Per-set statistics: Accuracy, total attempts, challenging cards
- Global statistics: Performance across all flashcard sets
- Card-level tracking: Individual question performance
- Progress over time: Cumulative learning metrics
Statistics are automatically saved to flashcard_stats.json.
# Show flashcard set selection menu
python main.py
# Study specific flashcard set
python main.py path/to/flashcards.yaml
# Use custom statistics file
python main.py --stats my_stats.json
# Show help
python main.py --help# Interactive mode - choose from available sets
python main.py
# Study Python basics directly
python main.py flashcard_sets/python_basic_flashcards.yaml
# Study Git with custom stats file
python main.py flashcard_sets/git_basics_flashcards.yaml --stats git_progress.json- Python 3.7+
- Dependencies listed in
requirements.txt:rich- Beautiful terminal UIPyYAML- YAML file supportpytest- Testing framework
Run the test suite:
python -m pytest test_flashcards.py -v- Regular practice - Study a little bit each day
- Mixed practice - Rotate between different flashcard sets
- Focus on mistakes - Pay attention to cards you get wrong
- Use statistics - Review your progress and identify weak areas
- Create custom sets - Add your own flashcards for specific topics
Happy studying! 🚀