Skip to main content

Modern Python CLI for automating GitHub Classroom assignment management

Project description

ClassDock

Automate GitHub Classroom assignment management with a modern Python CLI

PyPI version Python Support Tests

What is ClassDock?

ClassDock is a command-line tool that helps instructors manage GitHub Classroom assignments efficiently. Instead of manually managing hundreds of student repositories, ClassDock automates common workflows like:

  • Discovering student repositories from GitHub Classroom
  • Managing student rosters with CSV imports from Google Forms
  • Distributing secrets and tokens to all student repos at once
  • Tracking assignment acceptance rates and student progress
  • Managing collaborators across multiple repositories
  • Automating repetitive tasks with scheduled workflows

Perfect for: Computer science instructors managing GitHub Classroom assignments for classes of any size.

Quick Start

Installation

# Install from PyPI (recommended)
pip install classdock

# Verify installation
classdock --version

Requirements: Python 3.10+ and Git

Your First Workflow

# 1. Navigate to your assignment directory
cd ~/my-assignment

# 2. Discover all student repositories from GitHub Classroom
classdock repos fetch

# 3. Import your student roster (from Google Forms CSV)
classdock roster init
classdock roster import students.csv --org=your-github-org

# 4. Check which students accepted the assignment
classdock roster status --org=your-github-org

# 5. Add secrets to all student repositories
classdock secrets add

That's it! You've automated what would normally take hours of manual work.

Core Features

๐Ÿ“‹ Roster Management (New in 0.2.0!)

Track student enrollment and assignment acceptance with SQLite database:

# Initialize roster database
classdock roster init

# Import students from Google Forms CSV
classdock roster import students.csv --org=cs101-fall2025

# View roster and acceptance rates
classdock roster status --org=cs101-fall2025

# List all students
classdock roster list --org=cs101-fall2025

# Export roster data
classdock roster export roster-backup.csv --org=cs101-fall2025

Features:

  • Import student rosters from CSV (Google Forms compatible)
  • Track assignment acceptance rates
  • Identify students who haven't started
  • Multi-organization support for multiple classes
  • Automatic sync with discovered repositories

๐Ÿ“š Roster Documentation | ๐Ÿš€ Quick Test Guide

๐Ÿ” Repository Discovery

Automatically find all student repositories for an assignment:

# Discover repositories from GitHub Classroom
classdock repos fetch

# Repositories are saved to student-repos.txt
# Automatically excludes instructor and template repos

๐Ÿ” Secret Management

Distribute tokens, API keys, and credentials to all student repos:

# Add secrets to all discovered repositories
classdock secrets add

# Remove secrets when assignment is complete
classdock secrets remove

# List current secrets
classdock secrets list

๐Ÿ‘ฅ Collaborator Management

Add or remove collaborators (TAs, graders) across all repositories:

# Add a TA to all student repos
classdock repos collaborator add --username ta-github-username

# Remove a collaborator
classdock repos collaborator remove --username ta-github-username

โš™๏ธ Workflow Orchestration

Run complete workflows with a single command:

# Run the complete assignment setup workflow
classdock assignments orchestrate

# Preview what would happen (dry run)
classdock --dry-run assignments orchestrate

Command Reference

Roster Commands

classdock roster init                           # Initialize database
classdock roster import <csv> --org=<org>       # Import students
classdock roster list [--org=<org>]             # List students
classdock roster status [--org=<org>]           # Show statistics
classdock roster sync --assignment=<name>       # Sync repos with roster
classdock roster export <output> [--org=<org>]  # Export roster
classdock roster add --email=<email> --name=<name> --org=<org>  # Add student
classdock roster link --email=<email> --github=<username>        # Link GitHub

Repository Commands

classdock repos fetch                           # Discover student repos
classdock repos collaborator add --username=<user>  # Add collaborator
classdock repos collaborator remove --username=<user>  # Remove collaborator

Secret Commands

classdock secrets add                           # Add secrets to repos
classdock secrets remove                        # Remove secrets
classdock secrets list                          # List current secrets

Assignment Commands

classdock assignments setup                     # Interactive setup wizard
classdock assignments orchestrate               # Run complete workflow
classdock assignments manage                    # Manage templates

Global Options

--dry-run          # Preview actions without executing
--verbose          # Show detailed output
--config FILE      # Use specific configuration file
--help             # Show help for any command

Configuration

ClassDock uses an assignment.conf file in your assignment directory:

# Minimal configuration
classroom_url="https://classroom.github.com/classrooms/123/assignments/456"
template_repo_url="https://github.com/your-org/assignment-template"
github_organization="your-github-org"
assignment_name="homework-1"

# Optional: Token configuration (uses ~/.config/classdock/token_config.json by default)
token_name="GITHUB_TOKEN"

# Optional: Secrets to distribute
secrets_list="API_KEY,DATABASE_URL"

# Optional: Enable roster sync in orchestrator
step_sync_roster=true

Configuration File Generation

# Interactive setup creates assignment.conf for you
classdock assignments setup

Common Workflows

Workflow 1: New Assignment Setup

# 1. Create assignment directory
mkdir homework-1 && cd homework-1

# 2. Run interactive setup
classdock assignments setup

# 3. Discover student repositories
classdock repos fetch

# 4. (Optional) Sync with roster
classdock roster sync --assignment=homework-1 --org=cs101

# 5. Add required secrets
classdock secrets add

Workflow 2: Mid-Semester Roster Tracking

# 1. Initialize roster (one-time)
classdock roster init

# 2. Import your student list
classdock roster import students.csv --org=cs101-fall2025

# 3. For each assignment, sync repos
cd assignment-1
classdock repos fetch
classdock roster sync --assignment=assignment-1 --org=cs101-fall2025

# 4. Check acceptance rates
classdock roster status --org=cs101-fall2025

Workflow 3: Complete Automation

# Enable roster sync in assignment.conf
echo "step_sync_roster=true" >> assignment.conf

# Run complete orchestrated workflow
classdock assignments orchestrate

# This will:
# 1. Sync template repository
# 2. Discover student repositories
# 3. Sync with roster (if enabled)
# 4. Manage secrets
# 5. (Optional) Assist students
# 6. (Optional) Cycle collaborators

Installation Options

Production Use (Recommended)

# Install from PyPI
pip install classdock

# Upgrade to latest version
pip install --upgrade classdock

Development Installation

# Clone repository
git clone https://github.com/hugo-valle/classdock.git
cd classdock

# Install with Poetry
poetry install

# Activate virtual environment
source $(poetry env info --path)/bin/activate

# Verify installation
classdock --help

Documentation

User Guides

Technical Documentation

Developer Resources

Requirements

  • Python: 3.10 or higher (3.11+ recommended)
  • Git: For repository operations
  • GitHub Account: With appropriate permissions for your classroom organization

Optional Dependencies

  • GitHub CLI (gh) - For enhanced authentication and PR management
  • Poetry - For development installation

Architecture

classdock/
โ”œโ”€โ”€ cli.py                    # Main CLI interface (Typer)
โ”œโ”€โ”€ assignments/              # Assignment management
โ”‚   โ”œโ”€โ”€ setup.py             # Interactive setup wizard
โ”‚   โ”œโ”€โ”€ orchestrator.py      # Workflow orchestration
โ”‚   โ””โ”€โ”€ manage.py            # Template management
โ”œโ”€โ”€ repos/                    # Repository operations
โ”‚   โ”œโ”€โ”€ fetch.py             # Repository discovery
โ”‚   โ””โ”€โ”€ collaborator.py      # Collaborator management
โ”œโ”€โ”€ secrets/                  # Secret management
โ”‚   โ”œโ”€โ”€ manager.py           # Secret operations
โ”‚   โ””โ”€โ”€ github_secrets.py    # GitHub API integration
โ”œโ”€โ”€ roster/                   # Roster management (NEW in 0.2.0)
โ”‚   โ”œโ”€โ”€ models.py            # Data models
โ”‚   โ”œโ”€โ”€ manager.py           # CRUD operations
โ”‚   โ”œโ”€โ”€ importer.py          # CSV/JSON import/export
โ”‚   โ””โ”€โ”€ sync.py              # GitHub sync integration
โ”œโ”€โ”€ automation/               # Scheduling and automation
โ”œโ”€โ”€ config/                   # Configuration management
โ”œโ”€โ”€ services/                 # Service layer
โ””โ”€โ”€ utils/                    # Utilities and helpers

Testing

ClassDock has comprehensive test coverage:

# Run all tests
poetry run pytest tests/ -v

# Run specific test suite
poetry run pytest tests/test_roster*.py -v

# Run with coverage
poetry run pytest tests/ --cov=classdock

# Quick functionality test
make test

Test Coverage:

  • 118+ tests for roster management
  • 70+ tests for core functionality
  • 100% pass rate
  • Integration and unit tests

Version History

Version 0.2.0 (Upcoming)

New Features:

  • ๐ŸŽ‰ SQLite Roster Management - Track student enrollment and assignment acceptance
  • ๐Ÿ“Š CSV Import - Import rosters from Google Forms with flexible column mapping
  • ๐Ÿ”„ Repository Sync - Link discovered repos to student roster
  • ๐Ÿ“ˆ Acceptance Tracking - Monitor which students accepted assignments
  • ๐Ÿข Multi-Organization - Manage rosters for multiple classes

Improvements:

  • Flexible CSV column name mapping (case-insensitive)
  • Support for Google Forms exported column names
  • Orchestrator integration with optional roster sync

Documentation:

  • Complete roster management guides
  • Migration guide for existing users
  • Testing documentation

Version 0.1.1 (Current)

  • Core GitHub Classroom automation
  • Repository discovery and management
  • Secret distribution
  • Collaborator management
  • Workflow orchestration

Support

Contributing

Contributions are welcome! Please see our Contributing Guide for details on:

  • Development workflow
  • Branching strategy
  • Testing requirements
  • Code style guidelines
  • Pull request process

License

MIT License - see LICENSE file for details.


ClassDock - Simplifying GitHub Classroom management, one command at a time.

Made with โค๏ธ for computer science educators.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classdock-0.2.0.tar.gz (192.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

classdock-0.2.0-py3-none-any.whl (227.7 kB view details)

Uploaded Python 3

File details

Details for the file classdock-0.2.0.tar.gz.

File metadata

  • Download URL: classdock-0.2.0.tar.gz
  • Upload date:
  • Size: 192.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for classdock-0.2.0.tar.gz
Algorithm Hash digest
SHA256 28cfe560a2996ee9d99751379685bdd0b4c17f170a0e375a814dc1d915331f54
MD5 fbf9b494335d7056061ea85e385e3969
BLAKE2b-256 7c874f355712ae6ec9ea1182acd3e73c2a0538f3e79d4e4c779ae8374ddd4236

See more details on using hashes here.

File details

Details for the file classdock-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: classdock-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 227.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for classdock-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d5c6b4240fe56e5b08c3ad84a7206cb35ea60634f24e565ef459c484640a224
MD5 c02441b2480f5ca1ab5ba63b15a54080
BLAKE2b-256 ec66af8da2b3e9979e67e1072fc9bbafd3fcf94453c1673cb9f2fab5b592814f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page