Export a single Google Classroom course (topics, coursework, and materials) into a local, topic-based archive that includes CSV indexes and a scenario summary.
- Lists all courses linked to the authenticated account and lets you select one for export.
- Downloads coursework (
courseWork) and standalone materials (courseWorkMaterials) grouped by classroom topic. - Saves Google Drive attachments (including Google Docs/Sheets/Slides) alongside CSV indexes and a chronological Markdown scenario.
- Python 3.10 or newer.
- A Google Cloud project with the Classroom API and Drive API enabled.
- OAuth 2.0 Desktop Client credentials (downloaded as
credentials.json).
- Clone the project
git clone https://github.com/<your-account>/classroom_extract.git cd classroom_extract
- Create and activate a virtual environment
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies
python -m pip install -r requirements.txt
- Add your Google OAuth credentials
- Download the OAuth client (Desktop type) JSON from Google Cloud Console.
- Rename it to
credentials.jsonand place it in the project root (same folder as the script).
Export the course you want either by ID, by exact name, or by selecting from the interactive list:
# Interactive selection (opens a browser for the first authentication)
python classroom_topic_export.py
# Target a specific course ID
python classroom_topic_export.py --course-id 1234567890
# Target a course by its exact name
python classroom_topic_export.py --course-name "My Classroom Course"Useful flags:
--reset-authremoves the stored token and re-triggers OAuth flow (useful if permissions changed).--console-authruns an out-of-band flow when a browser cannot be opened.--no-downloadskips fetching Drive files and only builds the indexes/metadata.--order classroom|created-desc|created-asccontrols how items are ordered in the generated scenario.
The exporter creates an Archive/<Course Name>/ directory containing:
- Topic subfolders with downloaded attachments under
fichiers/. index.csvfor the whole course.index_topic.csvinside each topic folder.scenario_pedagogique.mdsummarising the timeline grouped by topic.
token.jsonis created automatically after the first successful login. Keep it private; the repository.gitignorealready excludes it.Archive/contains exported course data and should not be committed.
This project started from the ideas and initial inspiration of sauriol/Classroom-Downloader. That repository has not been updated for several years, so the current implementation has been rewritten and extended to work with recent Google Classroom and Drive APIs while adding topic-based exports and richer metadata.
Released under the MIT License. When you reuse or redistribute this project (including any derivatives), please keep the copyright and license notice intact and add a clear attribution to Etienne Vaytilingom with a link back to this repository so others know where the project originated.