Skip to content

Repository files navigation

Lecture Scraper

A web application that extracts content from PDF and PowerPoint files using a Python Flask backend and HTML/JavaScript frontend.

Features

  • File Upload: Drag & drop interface for PDF and PowerPoint files
  • Content Extraction: Extracts text, pages, slides, and speaker notes
  • Multiple Export Formats: JSON, Markdown, or plain text
  • Real-time Processing: Immediate feedback during file processing
  • Fallback Processing: Client-side demo processing if backend is unavailable

Setup

Backend Requirements

pip install -r requirements.txt

Running the Application

  1. Start the Backend Server:

    python app.py

    The server will run on http://localhost:5000

  2. Open the Frontend:

    • Open index.html in your web browser, or
    • Navigate to http://localhost:5000/ if you want to serve it through Flask

How It Works

Backend (Flask)

  • /upload - Handles file uploads and processes them immediately
  • /process - Processes uploaded files (currently returns success status)
  • /download/<filename> - Downloads processed files (placeholder implementation)

Frontend (HTML/JavaScript)

  • Drag & Drop Interface: Modern, responsive UI for file uploads
  • Real-time Processing: Shows progress and results immediately
  • Format Selection: Choose output format (JSON, Markdown, Text)
  • Download Options: Download results in your preferred format

File Processing

Supported Formats

  • PDF: Extracts text from all pages using pdfplumber
  • PowerPoint: Extracts text from slides and speaker notes

Output Structure

{
  "file_type": "PDF|PowerPoint",
  "file_name": "filename.ext",
  "full_text": "Complete extracted text",
  "pages": [...],  // For PDFs
  "slides": [...]  // For PowerPoint
}

Architecture

Frontend (HTML/JS) ←→ Backend (Flask)
                           ↓
                    File Processing
                           ↓
                    Content Extraction
                           ↓
                    JSON Response

Troubleshooting

  • Backend not running: Frontend will fall back to demo processing
  • File upload errors: Check file type and size
  • Processing errors: Check console for detailed error messages

Development

  • Backend: Modify app.py to add new routes or processing logic
  • Frontend: Edit index.html to change the UI or add features
  • File Processing: Extend the LectureScraper class in app.py

Notes

  • Files are processed in memory and cleaned up after processing
  • The system currently doesn't persist processed files
  • Download functionality creates files on-the-fly from processed content

About

scrapes the lecture and creates flashcards (work in progress)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages