A comprehensive toolkit for creating interactive Jupyter notebook lab exercises with progress tracking, validation, and rich display utilities.
Project description
Jupyter Lab Progress
A comprehensive Python library for creating interactive lab exercises in Jupyter notebooks. Designed for educators, workshop leaders, and content creators who want to build engaging, validated learning experiences.
🚀 Features
- 📊 Progress Tracking: Visual progress bars, step completion tracking, persistence support
- ✅ Comprehensive Validation: Variable, function, output, DataFrame, and custom validation methods
- 🎨 Rich Display Utilities: Info boxes, warnings, code blocks, tables, tabs, hints, and more
- 💾 Persistence: Save and restore progress across sessions
- 🔗 Seamless Integration: Validators automatically update progress trackers
- 🎓 Education-Focused: Built specifically for teaching and learning scenarios
📦 Installation
pip install jupyter-lab-progress
For development installation:
git clone https://github.com/mrlynn/jupyter-lab-progress.git
cd jupyter-lab-progress/jupyter-lab-progress
pip install -e ".[dev]"
🏃♂️ Quick Start
from jupyter_lab_progress import LabProgress, LabValidator, show_info, show_success
# Create a progress tracker
progress = LabProgress(["Load Data", "Process Data", "Analyze Results"],
lab_name="Data Science Lab")
# Create a validator linked to progress
validator = LabValidator(progress_tracker=progress)
# Show instructions
show_info("Let's start by loading the dataset", title="Step 1")
# Validate and mark progress
data_loaded = True # Your actual condition
validator.validate_and_mark_complete("Load Data", data_loaded)
# Display success message
show_success("Great job! Data loaded successfully")
📚 Core Components
1. Progress Tracking (LabProgress)
Track student progress through lab exercises with visual feedback:
from jupyter_lab_progress import LabProgress
# Basic usage
progress = LabProgress(["Step 1", "Step 2", "Step 3"])
progress.mark_done("Step 1")
# Advanced features
progress = LabProgress(
steps=["Load Data", "Clean Data", "Analyze"],
lab_name="Data Analysis Lab",
persist=True # Save progress to file
)
# Mark with score and notes
progress.mark_done("Load Data", score=95, notes="Excellent work!")
# Partial progress
progress.mark_partial("Clean Data", 0.75) # 75% complete
2. Validation Framework (LabValidator)
Comprehensive validation methods for checking student work:
from jupyter_lab_progress import LabValidator
validator = LabValidator()
# Variable validation
validator.validate_variable_exists("my_var", globals(), expected_type=list)
# Function validation
validator.validate_function_exists("process_data", globals(),
expected_params=["data", "method"])
# DataFrame validation
validator.validate_dataframe(df,
expected_shape=(100, 5),
expected_columns=["id", "name", "value"])
# Custom validation with auto-progress updates
validator = LabValidator(progress_tracker=progress)
validator.validate_and_mark_complete("Step 1", condition=True)
3. Display Utilities
Rich display functions for better communication:
from jupyter_lab_progress import *
# Messages
show_info("This is informational")
show_success("Well done!")
show_warning("Be careful")
show_error("Something went wrong")
# Code display
show_code("print('Hello World')", language="python", title="Example")
# Interactive elements
show_hint("Try using pandas read_csv function")
show_progress_bar(3, 10, label="Overall Progress")
show_checklist({"Task 1": True, "Task 2": False})
# Data display
show_json({"key": "value"}, title="Results")
show_table(headers=["Name", "Score"], rows=[["Alice", "95"]])
🔧 Advanced Usage
Custom Validators
# Create step-specific validators
validator = LabValidator(progress_tracker=progress)
validate_step1 = validator.create_step_validator("Step 1")
# Use custom validation
result = compute_something()
validate_step1(result == expected_value,
success_msg="Perfect calculation!",
failure_msg="Check your math")
Persistence
# Progress automatically saves/loads
progress = LabProgress(steps, persist=True, persist_file="my_lab.json")
Integration Example
from jupyter_lab_progress import *
# Complete lab setup
steps = ["Import Libraries", "Load Data", "Preprocess", "Train Model"]
progress = LabProgress(steps, lab_name="ML Workshop", persist=True)
validator = LabValidator(progress_tracker=progress)
# Step 1: Instructions
show_info("First, import required libraries", title="Step 1")
show_code("import pandas as pd\\nimport numpy as np")
# Validation with auto-progress
try:
import pandas as pd
import numpy as np
validator.validate_and_mark_complete("Import Libraries", True)
except ImportError:
show_error("Missing libraries. Run: pip install pandas numpy")
🎯 Use Cases
- Educational Workshops: Interactive coding workshops with guided exercises
- Corporate Training: Employee training programs with progress tracking
- Online Courses: Self-paced learning with automated validation
- Data Science Bootcamps: Hands-on exercises with immediate feedback
- Research Training: Academic lab exercises with validation
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/mrlynn/jupyter-lab-utils.git
cd jupyter-lab-utils/jupyter-lab-progress
pip install -e ".[dev]"
pre-commit install
Running Tests
pytest
pytest --cov=jupyter_lab_progress --cov-report=html
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Documentation: https://github.com/mrlynn/jupyter-lab-utils#readme
- Issues: GitHub Issues
- Discussions: GitHub Discussions
🏗️ Built by Michael Lynn https://mlynn.org
Created with ❤️ by the MongoDB Developer Relations team to enhance the learning experience in data science and development workshops.
Happy Teaching and Learning! 🎓
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyter_lab_progress-1.1.4.tar.gz.
File metadata
- Download URL: jupyter_lab_progress-1.1.4.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
202b290703667f2cc341c33b37606df45c50fd7e03906aeb54faae32710d9c3f
|
|
| MD5 |
bb3ca605c98db1995fc14ddd4117d6ac
|
|
| BLAKE2b-256 |
5db5c1141704d19569de106fd1e1faf61fcd189bdd25f9896609c992a96ce43d
|
Provenance
The following attestation bundles were made for jupyter_lab_progress-1.1.4.tar.gz:
Publisher:
python-publish.yml on mrlynn/jupyter-lab-progress
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyter_lab_progress-1.1.4.tar.gz -
Subject digest:
202b290703667f2cc341c33b37606df45c50fd7e03906aeb54faae32710d9c3f - Sigstore transparency entry: 270490321
- Sigstore integration time:
-
Permalink:
mrlynn/jupyter-lab-progress@deb97a2b6a418fb1d6989050c2182828d3e86141 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/mrlynn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@deb97a2b6a418fb1d6989050c2182828d3e86141 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jupyter_lab_progress-1.1.4-py3-none-any.whl.
File metadata
- Download URL: jupyter_lab_progress-1.1.4-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41b63509997270f1bbe7b7f274bd418b4190a40734e1018e85678e102811f0ed
|
|
| MD5 |
2d08f9fd5c302eb725f16e427326192d
|
|
| BLAKE2b-256 |
1beb00793163cf8deba9a7904dd3c5b77039c42ddafd19867b42c0dee4e412eb
|
Provenance
The following attestation bundles were made for jupyter_lab_progress-1.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on mrlynn/jupyter-lab-progress
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyter_lab_progress-1.1.4-py3-none-any.whl -
Subject digest:
41b63509997270f1bbe7b7f274bd418b4190a40734e1018e85678e102811f0ed - Sigstore transparency entry: 270490335
- Sigstore integration time:
-
Permalink:
mrlynn/jupyter-lab-progress@deb97a2b6a418fb1d6989050c2182828d3e86141 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/mrlynn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@deb97a2b6a418fb1d6989050c2182828d3e86141 -
Trigger Event:
release
-
Statement type: