Jupyter Integration
Run and monitor Jupyter notebook servers directly from Stanza’s CLI. The integration provides persistent server management, real-time notebook monitoring, and automatic cell output logging - all designed to streamline interactive development workflows.

Quick Start
Installation Requirements
Jupyter integration requires additional dependencies:
This installs:
jupyter_serverfor server managementjupyter_corefor runtime discovery- Required dependencies for log streaming and monitoring
Start a Jupyter server in your project directory:
The server runs in the background and persists across terminal sessions, making it ideal for long-running experiments on remote machines.
Server Management
Starting the Server
Launch a persistent Jupyter server that survives terminal closure:
Or via CLI:
The server automatically configures:
- Auto-logging of cell outputs to
notebook_name.logfiles - Authentication tokens for secure access
- Background process management with graceful shutdown
Checking Status
Get server information including uptime and URL:
Via CLI:
Stopping the Server
Gracefully shutdown using escalating strategies (REST API CMD → SIGTERM → SIGKILL):
Via CLI:
Notebook Monitoring
Listing Active Sessions
View all running notebook kernels with their log file metadata:
Via CLI:
Viewing Logs
Monitor notebook output in real-time without interrupting execution:
The logs command is useful for monitoring long-running experiments while preserving the ability to detach without affecting the notebook kernel.
Attaching to Notebooks
Connect directly to a notebook kernel with interactive control:
When attached:
- Ctrl+C: Kills the notebook kernel and exits
- ESC (twice): Exits without killing the kernel
- Output streams in real-time directly to your terminal
This mode is ideal for active development and debugging when you need full control over kernel lifecycle.
Python API Examples
Complete Server Workflow
Programmatic Log Streaming
Kernel Management
Auto-Logging
When you start the Jupyter server through Stanza, cell outputs are automatically logged to {notebook_name}.log files in the same directory as each notebook. This enables:
- Persistent record of all cell executions
- Real-time monitoring via
stanza jupyter logs - Post-experiment analysis without re-running cells
Log files capture stdout, stderr, and display outputs, providing a complete record of your notebook’s execution history.
Remote Development
For SSH sessions to lab computers, use port forwarding to access Jupyter in your local browser:
The persistent server ensures your notebooks keep running even if your SSH connection drops.
Tips and Best Practices
Background execution: The server runs as a detached process, so you can close your terminal without stopping Jupyter. Use stanza jupyter status to rediscover the URL after reconnecting.
Monitor long experiments: Use stanza jupyter logs to check progress on multi-hour measurements without opening the browser or disrupting execution.
Clean shutdown: Always use stanza jupyter stop to gracefully shutdown the server. This ensures proper cleanup of runtime files and state.
Port conflicts: If port 8888 is already in use, specify a different port with --port 8889 when starting the server.
Next Steps
- Data Logging - Configure automatic logging for routine outputs
- Sessions - Organize experiments with session management
- Live Plotting - Visualize data in real-time as measurements run
- Jupyter Integration - Run and monitor Jupyter notebook servers

