A Flask web app that extracts text from uploaded PDF notes and generates an AI-powered summary with key points using the Anthropic API.
- Upload a PDF (lecture notes, textbook excerpts, study materials)
- Extracts text from the PDF automatically
- Sends the content to Claude for summarization
- Returns a concise summary and a list of key points
- Clean, responsive UI with side-by-side layout on desktop
- Backend: Python, Flask
- PDF Extraction: PyMuPDF (fitz)
- AI Summarization: Anthropic API (Claude)
- Frontend: HTML, CSS, Bootstrap, Jinja2
- Environment Management: python-dotenv
study-assistant/
├── app.py # Flask app, routes, and helper functions
├── templates/
│ └── index.html # Main UI template
├── static/
│ └── style.css # Custom styles
├── uploads/ # Temporary PDF storage
├── .env # API key (not committed)
├── .gitignore
└── requirements.txt
- Python 3.x
- An Anthropic API key
- Clone the repository
git clone https://github.com/yourusername/study-assistant.git
cd study-assistant- Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Create a
.envfile in the project root and add your API key
ANTHROPIC_API_KEY=your_api_key_here
- Run the app
flask run- Open your browser and go to
http://127.0.0.1:5000
- Click the upload area or browse to select a PDF file
- Click Upload & Summarize
- The app extracts the text, sends it to Claude, and displays a summary with key points
- File uploads are validated for
.pdfextension only - Filenames are sanitized using
werkzeug.utils.secure_filename - API keys are stored in
.envand never committed to version control
- Quiz and flashcard generation from uploaded notes
- Support for saving and revisiting past summaries
- Token limit handling for very large PDFs
- Deployment to a live URL