Skip to main content

Steel Bank Course - A comprehensive toolkit for managing Jupyter notebook-based courses with interactive widgets, leaderboards, and gamification

Project description

SBC - Steel Bank Course

A comprehensive Python toolkit for managing Jupyter notebook-based courses with interactive widgets, persistent state, leaderboards, and gamification.

Features

For Students

  • Interactive Widgets - Quizzes, flashcards, trivia games, code puzzles, and reflections
  • State Persistence - Automatically resume activities where you left off
  • Gamification - Streaks, points, and leaderboard competition
  • PDF Export - Export notebooks to PDF with source attachment

For Instructors

  • YAML-based Content - Define quizzes, flashcards, and challenges in simple YAML
  • Assignment Distribution - Strip solutions and generate student versions
  • Score Tracking - Discord-based leaderboards with multiple metrics
  • Course Templates - Quickly scaffold new course structures

Installation

pip install sbcourse

# For Discord bot functionality
pip install sbcourse[bot]

Quick Start

In Jupyter Notebooks

# Load the extension
%load_ext sbc

# Run a quiz
%quiz week-01

# Play trivia
%trivia calculus -n 5

# Study flashcards
%flashcards derivatives

# Write a reflection
%%reflection week-01
What did you learn about derivatives this week?

# Export to PDF (with .ipynb attached)
%pdf

Command Line

# Create a new course
sbc new my-course

# Generate student assignment (strips solutions)
sbc assign assignment-01 --push

# Show configuration
sbc cfg show

# Run Discord leaderboard bot
sbc bot run

Magic Commands

Command Description
%quiz <name> Load and display an interactive quiz
%trivia [topic] [-n NUM] Start a trivia game
%flashcards <deck> Load flashcard deck for study
%leaderboard [--weekly] [--fair] Display course leaderboard
%%reflection <name> Create reflection prompt (cell body is prompt)
%pdf [filename] Export notebook to PDF
%index [--rebuild] Build semantic search index
%%search [-n NUM] Search course notebooks
%assign <notebook> Generate student version
%update <files> Commit and push files

Content Formats

Quiz Format (YAML)

title: Week 1 Quiz
questions:
  - question: What is the derivative of x^2?
    options:
      - "x"
      - "2x"
      - "x^2"
    answer: 1
    explanation: Power rule - bring down the exponent and subtract 1

Flashcard Format (YAML)

title: Calculus Fundamentals
cards:
  - front: What is the derivative of sin(x)?
    back: cos(x)
  - front: What is the integral of 1/x?
    back: ln|x| + C

Leaderboard Setup

1. Configure Students

from sbc.leaderboard import configure

configure(
    api_url="https://your-bot.fly.dev",
    api_secret="your-secret",
    student_id="jsmith",
    display_name="Jane Smith",
    cohort="F25-06623"
)

2. Run Discord Bot

export DISCORD_TOKEN="your-bot-token"
export API_SECRET="your-api-secret"
sbc bot run --port 5000

3. Discord Commands

  • /leaderboard [metric] [cohort] - Display standings
  • /mystats - View your personal statistics
  • /cohorts - List all cohorts

Project Structure

sbc/
├── src/sbc/
│   ├── widgets/           # Interactive Jupyter widgets
│   │   ├── quiz.py        # Multiple choice quizzes
│   │   ├── trivia.py      # Timed trivia games
│   │   ├── flashcards.py  # Spaced repetition cards
│   │   ├── reflection.py  # Free-form responses
│   │   └── puzzles.py     # Code challenges
│   ├── persistence/       # State management
│   ├── leaderboard/       # Score tracking
│   │   ├── client.py      # Notebook client
│   │   └── server/        # Discord bot + API
│   ├── magic.py           # IPython magic commands
│   ├── pdf.py             # PDF export
│   ├── search.py          # Semantic search
│   ├── cli.py             # Command-line interface
│   └── config.py          # Configuration system
└── pyproject.toml

Configuration

SBC uses a hierarchical configuration system:

  1. Default values (built-in)
  2. ~/.sbc.toml - User-level config
  3. .sbc.toml - Project-level config
  4. SBC_* environment variables

Generate a template:

sbc cfg init

Assignment Generation

Mark solution code in notebooks:

# Code cells
### BEGIN SOLUTION
answer = 42
### END SOLUTION
<!-- Markdown cells -->
<!-- BEGIN SOLUTION -->
The answer is 42.
<!-- END SOLUTION -->

Generate student version:

sbc assign assignment-01 --push

PDF Export Options

%pdf                  # Default: attach .ipynb, add header
%pdf report.pdf       # Custom filename
%pdf --no-attach      # Don't attach source notebook
%pdf --no-header      # Skip timestamp header
%pdf --no-save        # Don't auto-save before export
%pdf -v               # Verbose output

Semantic Search

Search across all course notebooks using ChromaDB for semantic similarity.

# Build the search index (one time)
%index

# Force rebuild the index
%index --rebuild

# Search for related content
%%search -n 5
What is a Gaussian process?

The search returns links to relevant notebook cells (markdown and code) ranked by semantic similarity to your query.

Development

# Install with dev dependencies
pip install -e ".[dev]"
# or with uv
uv pip install -e ".[dev]"

# Run tests
pytest

# Lint code
ruff check src/

License

MIT License - see LICENSE file for details.

Author

John Kitchin (jkitchin@andrew.cmu.edu)

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

sbcourse-0.1.6.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

sbcourse-0.1.6-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

Details for the file sbcourse-0.1.6.tar.gz.

File metadata

  • Download URL: sbcourse-0.1.6.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbcourse-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c1700bba4aa9e0b7bb7a05dd2c51d48267d1fa605e6ce015309ef21bb7eaae66
MD5 6b8e22d51a649d605e44ea67f64eb588
BLAKE2b-256 8de8f89434f2784f19cbf2162ce9e220f7d596957f07f92d93b082835b9875e2

See more details on using hashes here.

File details

Details for the file sbcourse-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sbcourse-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 48.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbcourse-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 94a15497a41d1eb8d72a574facd1d48ab8c05bd7fb0438d5066ae3385b3d72cd
MD5 c764b905dce749409ec78ac0b1696d44
BLAKE2b-256 a03e6c5b45979ec3bc96e98f05d64345fb9d4e9ae53bdce659df58f0ef7369e1

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