Skip to main content

Live Experiments for Active Pedagogy

Project description

LEAP2

Live Experiments for Active Pedagogy — An interactive platform that turns Python functions into live, multi-student experiments. Drop functions in a folder, and students call them from Python, JavaScript, Julia, C, or C++ while every call is logged for analysis and visualization.

Quick Start

Prerequisites: Python 3.10+

# Install (pick one)
pip install git+https://github.com/leaplive/LEAP2.git    # from GitHub
pip install -e .                                           # from local clone

# Set up and run
leap init                    # create lab structure, set admin password
leap run                     # start server at http://localhost:9000

Open http://localhost:9000 — the landing page lists available experiments.

How It Works

1. Write a function:

# experiments/my-lab/funcs/functions.py
def square(x: float) -> float:
    """Return x squared."""
    return x * x

2. Students call it remotely:

from leap.client import Client
c = Client("http://localhost:9000", student_id="s001", experiment="my-lab")
c.square(7)  # 49

Every call is automatically logged with args, result, timestamp, student ID, and trial name. Logs are queryable via API, CLI, or the built-in web UI.

Clients are available in Python, JavaScript, Julia, C, and C++ — students use whichever language their course requires.

Key Features

Feature Description
RPC Server Python functions auto-exposed as HTTP endpoints
Per-Experiment Isolation Each experiment has its own functions, UI, and DuckDB database
Automatic Logging Every call logged with args, result, timestamp, student ID, trial
Student Registration Per-experiment registration with admin management and bulk CSV import
Rate Limiting Per-function, per-student; default 120/min; configurable via @ratelimit
Decorators @nolog, @noregcheck, @ratelimit, @adminonly, @withctx
Multi-Language Clients Python, JavaScript, Julia, C, C++
Decoupled Visualizations Log Client abstraction for building dashboards
CLI + Web leap CLI and FastAPI web API share the same logic
Sharing Git-based distribution; optional community registry
Polished UI Dark/light themes, sparklines, inline counts, academic fonts

Concepts

LEAP organizes work into labs and experiments:

  • Experiment — A self-contained unit: Python functions in funcs/, optional UI in ui/, its own DuckDB database, and a README.md with frontmatter. Can be hosted independently on GitHub for sharing, but always runs inside a lab.
  • Lab — A project root containing one or more experiments. Clone a lab, run leap init, and everything is ready.
my-lab/                      ← lab
├── README.md                # type: lab
├── config/
└── experiments/
    ├── sorting-viz/         ← experiment
    │   ├── README.md        # type: experiment
    │   ├── funcs/
    │   └── ui/
    └── graph-search/        ← experiment

Creating & Sharing Experiments

You must be inside an initialized lab (leap init) to add experiments.

leap add my-experiment                          # scaffold a new local experiment
leap add https://github.com/user/cool-lab.git   # install from Git
leap remove my-experiment                        # remove an experiment

leap add <url> clones the experiment, installs requirements.txt, tracks it in your lab's README, and adds it to .gitignore. Running it again on an already-installed experiment pulls updates.

Sharing your work: Push to GitHub and share the URL. Others install with leap add <url>.

Decorators

from leap import adminonly, nolog, noregcheck, ratelimit, withctx, ctx

@nolog                          # skip logging (high-frequency calls)
def step(dx): return dx * 2

@noregcheck                     # open to all, no registration required
def echo(x): return x

@adminonly                      # admin sessions only
def reset_data(): clear_all()

@ratelimit("10/minute")         # custom rate limit
def expensive(x): return run_sim(x)

@withctx                        # access caller context via ctx
def start():
    return {"student": ctx.student_id, "trial": ctx.trial}

Functions are hot-reloadable at runtime via the admin UI or POST /exp/<name>/admin/reload.

CLI Reference

Command Purpose
leap run Start the server
leap init Set up a lab (idempotent)
leap add <name|url|path> Add experiment (scaffold, clone, or copy)
leap remove <name> Remove an experiment
leap list List experiments
leap validate <name> Validate experiment setup
leap discover [--tag] Browse the community registry
leap publish <name> Publish to the registry
leap export <exp> [--format] Export logs (jsonlines or csv)
leap set-password Set admin password
leap add-student <exp> <id> Add a student
leap import-students <exp> <csv> Bulk-import students from CSV
leap list-students <exp> List students
leap config Show resolved configuration
leap doctor Validate setup, resolve mismatches
leap version Show version

Documentation

Full documentation is available at github.com/leaplive/LEAP2.

Citation

If you use LEAP in your work, please cite our poster presented at ACM SIGCSE TS 2026:

Sumedh Karajagi, Sampad Bhusan Mohanty, and Bhaskar Krishnamachari. 2026. LEAP -- Live Experiments for Active Pedagogy. In Proceedings of the 57th ACM Technical Symposium on Computer Science Education (SIGCSE TS 2026). ACM. DOI: 10.1145/3770761.3777313

@inproceedings{karajagi2026leap,
      title={LEAP -- Live Experiments for Active Pedagogy},
      author={Sumedh Karajagi and Sampad Bhusan Mohanty and Bhaskar Krishnamachari},
      booktitle={Proceedings of the 57th ACM Technical Symposium on Computer Science Education (SIGCSE TS 2026)},
      year={2026},
      publisher={ACM},
      doi={10.1145/3770761.3777313},
      eprint={2601.22534},
      archivePrefix={arXiv},
      url={https://arxiv.org/abs/2601.22534},
}

License

MIT

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

leaplive-2.0.2.tar.gz (92.9 kB view details)

Uploaded Source

Built Distribution

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

leaplive-2.0.2-py3-none-any.whl (105.1 kB view details)

Uploaded Python 3

File details

Details for the file leaplive-2.0.2.tar.gz.

File metadata

  • Download URL: leaplive-2.0.2.tar.gz
  • Upload date:
  • Size: 92.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for leaplive-2.0.2.tar.gz
Algorithm Hash digest
SHA256 41d5696ef89f8796d6606783d66334d8ab17ef4387e5316959254f5b640f2d43
MD5 f7756d238c4f202f37b06cb18891563f
BLAKE2b-256 bf2f59cc4f83d283fd3c8f1f827c2450c46d4c339415d5595dadcd650566b92e

See more details on using hashes here.

File details

Details for the file leaplive-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: leaplive-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 105.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for leaplive-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebba443256546b2dddf0547c1e02e270805736fc34aef9a18a179a9b84676d94
MD5 f47c88533ed13f1cbbe89c6250260a7a
BLAKE2b-256 4e508cff718f43bb1a0cbd9717b61abc89f06f2e331bdc1459e1625ced1550ae

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