Skip to main content

steps-widget

Jupyter widget and CLI that trace Python expression evaluation step by step.

  • %%steps -- a cell magic (registered by import steps_widget) that renders the substitution/reduction trace of any # PRINT STEPS-tagged statement as a widget below the cell.
  • print-steps -- the command-line equivalent: print-steps student_script.py prints the same trace to stderr for every tagged line in a script.

Tag convention: append # PRINT STEPS (or #PRINT-STEPS, # printsteps, ... -- see steps_widget.print_steps._COMMENT_TAGS for every recognized spelling) to a statement to have it evaluated one operation at a time instead of all at once.

import steps_widget

%%steps
x = 7
y = 5
z = x * y + 4  # PRINT STEPS

Requires Python 3.10 through 3.13 -- the stepper dispatches on CPython bytecode opcode names, which change across these versions; each is handled by its own dispatch table (see CLAUDE.md).

pip install steps-widget
# or
conda install -c munch-group steps-widget

See the docs for more.

Initial set up

pixi run init

Get updates to upstream fork

Add upstream if not already added

git remote add upstream https://github.com/munch-group/steps-widget.git

Fetch upstream changes

git fetch upstream

Either rebase your changes on top of upstream (cleaner history)

git rebase upstream/main

Or, merge upstream into your fork (preserves history)

git merge upstream/main

If you want to see what's changed upstream before applying:

git log HEAD..upstream/main

See the actual diff

git diff HEAD...upstream/main

Then push your updated fork:

git push origin main

If you rebased and need to force push

git push origin main --force-with-lease

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steps_widget-0.2.5.tar.gz (427.6 kB view details)

Uploaded Source

Built Distribution

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

steps_widget-0.2.5-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file steps_widget-0.2.5.tar.gz.

File metadata

  • Download URL: steps_widget-0.2.5.tar.gz
  • Upload date:
  • Size: 427.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for steps_widget-0.2.5.tar.gz
Algorithm Hash digest
SHA256 f787f0d8bbd2c8c360807e04305cb1091d5a26df282b1dc010d33db06318b6fc
MD5 a65967db6a394bbf8c9902be4b47df07
BLAKE2b-256 1142bc44df87b2b4fbef1df1173e1fe9883f277b4b783d36c67d92eb16db7e3d

See more details on using hashes here.

File details

Details for the file steps_widget-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: steps_widget-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for steps_widget-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 824c6bde1e6c610b5f7c25b42114ea8ff7c548cd60aae76ce4cd36d5c1d5da4c
MD5 15629c7f9da935c84b03b6f99b094f1b
BLAKE2b-256 cda81728d5c16d8e9d9a3a2830ee291c9c349c46552addc1c3ce1542d0515dd6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.10

2 files

0.2.9

2 files

0.2.7

2 files

This release

0.2.5 This release

2 files

0.2.3

2 files

0.2.1

2 files

0.1.22

2 files

0.1.20

2 files

0.1.18

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page