learnlog
A Python package that automatically logs code development and program runs.
By adding import learnlog as the first import in a Python file, every
program run is recorded transparently: source code changes, command-line
arguments, standard input/output/error, and unhandled exceptions. The data is
stored in a hidden local Git repository.
Use cases
-
Sharing live-coding sessions. A teacher adds
import learnlogto demonstration scripts during a lecture or tutorial. After the session the teacher pushes the log to a remote repository:learnlog set-remote git@gitlab.kth.se:dbosk/lecture01.git learnlog push
Students clone the log and replay it step by step:
learnlog clone git@gitlab.kth.se:dbosk/lecture01.git learnlog play
Alternatively, when a shared Git remote is not available, the teacher can export the log as a portable bundle file:
learnlog export -o lecture01.bundle
The teacher distributes the file (e.g. via a course page) and students replay it directly:
learnlog play lecture01.bundle
Older recordings can also be reused as debugging case studies for later students.
-
Studying, supporting, and reviewing how students code. A researcher creates an empty Git repository for each student. Each student adds
import learnlogto their programs and pushes the log:learnlog set-remote git@gitlab.kth.se:dbosk/alice-log.git learnlog push
The researcher then clones each student's repository to analyse the development data:
learnlog clone git@gitlab.kth.se:dbosk/alice-log.git learnlog play learnlog analyse X-Tag=lab1 X-Tag=lab2
The
analysecommand generates LaTeX reports of edit--run cycles. The optional positional arguments filter events byColumn=Regexboundaries—here, only events between tagslab1andlab2are included.Alternatively, the student can export the log as a bundle and submit it through the course platform:
learnlog export -o alice-log.bundle
The researcher then replays it directly:
learnlog play alice-log.bundle
This gives a complete timeline of how students develop and debug their code. Students can use it for self-review, or show a TA what they already tried before asking for help. Teachers can reuse old recordings of authentic problems as debugging instruction material, train TAs on common difficulty patterns and authentic debugging traces, inspect development paths during assessment moderation, improve assignments and curricula, and compare cohorts or interventions. The same recordings also support reproducible bug reports, research on programming process, and authorship review, including possible AI-assisted or externally authored work when the final submission does not match the recorded development path.
Release files for learnlog 0.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| learnlog-0.19.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| learnlog-0.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.8 kB
Release files / learnlog-0.19.tar.gz
| Download URL | learnlog-0.19.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
435c5786708f719d64417c152ec877bf9ef1ed13db279a649849ba25b70371db
|
|
BLAKE2b-256 checksum How to use checksums |
6cb9bafa92178c5cce57e1bd97bfa0f16faf35e729d84ef42530c28b1f0c3a34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.13.7 Linux/6.17.0-41-generic
|
Release files / learnlog-0.19-py3-none-any.whl
| Download URL | learnlog-0.19-py3-none-any.whl |
|---|---|
| Size | 59.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55115572aa6515aee5576f884aba148892e4f3b332ab5172cb8896624d92b9ec
|
|
BLAKE2b-256 checksum How to use checksums |
42484d44c54cb9e42163be84b514ae46f44f91948f67daa25902d9233f2ce556
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.13.7 Linux/6.17.0-41-generic
|