Skip to content

Add --verbose flag to exec_nb for real-time output #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radekosmulski
Copy link

This PR adds a --verbose flag to the exec_nb command-line tool to display stdout/stderr output in real-time during
notebook execution.

Motivation:
When running long-running notebooks from the command line, it's helpful to see progress and output as it happens, rather
than waiting until the entire notebook completes.

Changes:

  • Added verbose parameter throughout the execution chain (CLI → execute → run_all → cell → run → run_cell → _run)
  • Modified CaptureShell._run to conditionally capture stdout/stderr based on the verbose flag
  • Updated help text and documentation

Usage:
exec_nb notebook.ipynb --verbose

Testing:
The feature has been tested with notebooks containing print statements, stderr output, and progress indicators. Output
correctly streams to the terminal when verbose is enabled while still being captured in the notebook when saved.

- Added verbose parameter throughout the execution chain
- Modified CaptureShell._run to conditionally capture stdout/stderr
- When --verbose is used, output streams to terminal in real-time
- Updated documentation in README.md and help text
Copy link

gitnotebooks bot commented Jun 7, 2025

Found 2 changed notebooks. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/execnb/pull/75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant