Generate Anki flashcards from Notion pages using AI.
Automatically creates diverse flashcards with proper syntax highlighting for code examples, supporting both local (Ollama) and cloud (Claude) AI providers.
- AI-powered flashcard generation (Ollama or Claude)
- Multiple question types: recall, conceptual, application, comparison, command
- Syntax-highlighted code blocks
- Works with private Notion pages
- Clean, styled Anki decks ready to import
git clone https://github.com/yourusername/flashygen.git
cd flashygen
uv sync # or: pip install -r requirements.txt-
Choose AI Provider
- Ollama (free, local): Install from ollama.ai, run
ollama pull phi3 - Claude (paid): Get API key from console.anthropic.com
- Ollama (free, local): Install from ollama.ai, run
-
Create Notion Integration
- Go to notion.so/my-integrations
- Create new integration, copy the token
-
Configure
cp .env.example .env # Edit .env and add your tokens -
Share Notion Pages
- Open your Notion page → "..." menu → "Add connections" → Select your integration
For detailed setup help, run:
python main.py setupBasic:
python main.py generate https://www.notion.so/your-page-urlOptions:
--provider, -p # AI provider: "ollama" (default) or "claude"
--output, -o # Output file path (default: page_title.apkg)
--cards, -c # Cards per concept (default: 3)
--deck-name, -d # Custom deck name (default: page title)Examples:
# Use Claude instead of Ollama
python main.py generate <url> -p claude
# Custom output with more cards
python main.py generate <url> -o my-deck.apkg -c 5
# All options
python main.py generate <url> -p claude -o deck.apkg -c 4 -d "Python Study""Configuration error: ANTHROPIC_API_KEY not found"
- Create
.envfile and add your API key without quotes
"Error fetching page: Could not find page"
- Share the Notion page with your integration (see setup step 4)
"No flashcards were generated"
- Page may be empty or have insufficient content
Generated .apkg file not working
- Install Anki, then double-click .apkg or import via File → Import
MIT License - see LICENSE file for details