A general-purpose autograder written primarily in Python 3.
Project description
lograder
A Python library for building programming assignment autograders. The central abstraction is a Pipeline of Step instances -- each step validates input, runs a process, and passes results forward.
Input -> Check -> Mixin -> Build -> Test
Installation
pip install lograder
# or for development:
pip install -e ".[dev]"
Minimal example
from pathlib import Path
from lograder.pipeline.config import config
from lograder.pipeline.input.local_directory import LocalDirectory
from lograder.pipeline.check.project.simple_project import CMakeManifestCheck
from lograder.pipeline.build.cmake import CMakeBuild
from lograder.pipeline.test.output_compare import OutputCompareTest, OutputCompareCase
from lograder.pipeline.score import TestCaseScorer, AllOrNothingScorer, GradescopeConfig
from lograder.pipeline.pipeline import Pipeline
# Define test cases
cases = [
OutputCompareCase(name="hello", args=[], expected_stdout="Hello, World!\n"),
OutputCompareCase(name="echo", args=["foo"], expected_stdout="foo\n"),
]
# Build the pipeline
pipeline = Pipeline()
pipeline.add(inp := LocalDirectory())
pipeline.add(check := CMakeManifestCheck())
pipeline.add(build := CMakeBuild())
pipeline.add(tests := OutputCompareTest("hello", cases))
# Attach scorers
build.scorer = AllOrNothingScorer(10.0, label="Build")
tests.scorer = TestCaseScorer({"hello": 40.0, "echo": 50.0}, label="Correctness")
# Run
with config(root_directory=Path("/autograder/submission")):
score = pipeline()
score.write_results_json(config=GradescopeConfig(visibility="visible"))
Documentation
| Doc | Contents |
|---|---|
| Getting started | First autograder in 5 minutes |
| Concepts | Pipeline, Step, Result, Manifest, Artifact |
| Input | LocalDirectory, EnvironmentConfig |
| Check | Manifest checks, SourceCheck, constraints |
| Build | CMakeBuild, MakefileBuild, BashScriptBuild, PrebuiltArtifacts |
| Test | All 9 test step types with full examples |
| Scoring | Scorers, Gradescope output, results.json |
| Process layer | TypedExecutable, CLIArgs, registry |
| Output / layouts | Logging, HTML report, custom layouts |
| Examples | Complete worked autograders |
Design principles
- Errors as values. Steps return
Result[Ok, Err]rather than raising. A fatalErrreturn stops the pipeline; a yieldedErris logged and execution continues. - Typed data flow. Each step declares its input and output types.
pipeline.validate_step_types()catches mismatches before the first submission runs. - No magic. Every process invocation goes through a
TypedExecutablewith validatedCLIArgs. You can see exactly what command was run and what it produced. - Library only. lograder has no CLI and no service. You write a Python script; lograder is a collection of reusable building blocks.
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
lograder-0.3.6.tar.gz
(121.7 kB
view details)
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
lograder-0.3.6-py3-none-any.whl
(184.8 kB
view details)
File details
Details for the file lograder-0.3.6.tar.gz.
File metadata
- Download URL: lograder-0.3.6.tar.gz
- Upload date:
- Size: 121.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
752f6979b2ab897cc58e75ca30ab746bc51e4b6860aa54fb75099306119b6579
|
|
| MD5 |
335d4ca045f230677379b359880bfacd
|
|
| BLAKE2b-256 |
e6a8a6f1b5a1c2bb2894023936558d38d09357430e2139ab450067d0d1816f9d
|
File details
Details for the file lograder-0.3.6-py3-none-any.whl.
File metadata
- Download URL: lograder-0.3.6-py3-none-any.whl
- Upload date:
- Size: 184.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10ca32746138898add5024adfa5fa758810cb5adabf038a3f2477285eb22d86e
|
|
| MD5 |
caffba5cd773f4e4388401243edf967d
|
|
| BLAKE2b-256 |
f51059a4629884e0f73e2cf7e908d35f49e105e3bcd366ba028423459ff39767
|