Skip to content

Arro38/classroom_topic_export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classroom Topic Export

Export a single Google Classroom course (topics, coursework, and materials) into a local, topic-based archive that includes CSV indexes and a scenario summary.

Features

  • 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.

Prerequisites

  • 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).

Quick Start

  1. Clone the project
    git clone https://github.com/<your-account>/classroom_extract.git
    cd classroom_extract
  2. Create and activate a virtual environment
    python3 -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies
    python -m pip install -r requirements.txt
  4. Add your Google OAuth credentials
    • Download the OAuth client (Desktop type) JSON from Google Cloud Console.
    • Rename it to credentials.json and place it in the project root (same folder as the script).

Usage

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-auth removes the stored token and re-triggers OAuth flow (useful if permissions changed).
  • --console-auth runs an out-of-band flow when a browser cannot be opened.
  • --no-download skips fetching Drive files and only builds the indexes/metadata.
  • --order classroom|created-desc|created-asc controls 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.csv for the whole course.
  • index_topic.csv inside each topic folder.
  • scenario_pedagogique.md summarising the timeline grouped by topic.

Authentication Artifacts

  • token.json is created automatically after the first successful login. Keep it private; the repository .gitignore already excludes it.
  • Archive/ contains exported course data and should not be committed.

Credits

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.

License

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.

About

Outil CLI Python pour exporter un cours Google Classroom (sujets, travaux, ressources) en archive locale

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages