CanvasToAI is a synchronization tool that connects your Canvas LMS assignments to Generative AI engines (ChatGPT and Google Gemini).
The application automates the tedious task of manually copying assignment details and uploading files to your favorite AI assistant by using Playwright behind the scenes.
- 🔗 Canvas API Integration: Fetches your upcoming, active assignments automatically.
- 📁 Auto-File Handling: Downloads all assignment attachments (PDFs, PPTXs, Source files) and prepares them for the AI.
- 🤖 Multi-AI Support: Fully automated, browser-based interaction with ChatGPT and Google Gemini.
- 🔐 Persistent Sessions: Log in once, and the bot remembers your session for future runs.
- 🖥️ Interactive UI: A simple, user-friendly interface powered by
tkinter.
- Python 3.9+
- Google Chrome installed (used for better bot detection avoidance).
Clone the repository and install the dependencies:
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install requirements
pip install -r requirements.txt
# Install Playwright browser drivers
playwright install chromiumRename .env.example to .env and fill in your details:
CANVAS_DOMAIN=https://canvas.yourschool.edu
CANVAS_API_TOKEN=your_token_hereTip
To get your Canvas API Token, go to Canvas → Account → Settings → New Access Token.
Run the main application:
python main.py- Open the app and click the Setup Login button for your preferred AI (ChatGPT or Gemini).
- A browser window will open; log in to your account manually.
- Close the browser when finished. The app will save your session!
- Refresh the assignment list in the UI.
- Select an assignment and pick your AI target.
- Click Play
▶️ — Watch the bot fetch context, upload files, and prepare your prompt!
Interested in learning how this works? Check out the workshop folder for step-by-step exercises to build your own Playwright automation bots from scratch!
Made for OKState ACM. For educational use only.