Skip to main content

CLI interface to a persistent Jupyter kernel for code execution with timeout handling

Project description

Jupyter Remote Runner

A CLI interface to a persistent Jupyter kernel for code execution with timeout handling and streaming output.

Installation

Install using pipx (recommended):

pipx install .

Or using pip:

pip install .

Usage

Commands

  • jupyter-remote-runner --help - Show help
  • jupyter-remote-runner start - Start the Jupyter kernel daemon
  • jupyter-remote-runner stop - Stop the daemon
  • jupyter-remote-runner status - Check daemon status
  • jupyter-remote-runner run <code> - Execute code in the persistent kernel

Run Command Options

  • --timeout <seconds> - Set execution timeout (default: 60)
  • --is-input - Send code as input to Python input() prompt

Examples

# Start the daemon
jupyter-remote-runner start

# Execute Python code
jupyter-remote-runner run "print('Hello World')"

# Execute shell command
jupyter-remote-runner run "!ls -la"

# Execute bash magic
jupyter-remote-runner run "%%bash\necho 'Hello from bash'"

# Continue previous command output
jupyter-remote-runner run " "

# Interrupt running command
jupyter-remote-runner run "C-c"

# Execute with custom timeout
jupyter-remote-runner run "import time; time.sleep(10)" --timeout 15

# Check status
jupyter-remote-runner status

# Stop the daemon
jupyter-remote-runner stop

Features

  • Persistent Kernel: Maintains state between commands
  • Streaming Output: Real-time output streaming
  • Timeout Support: Configurable execution timeouts
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Background Daemon: Runs kernel in background process
  • Signal Handling: Support for interrupting long-running commands
  • Input Support: Handle Python input() calls

Development

Run tests:

python test_cli.py

Run directly from source:

python -m jupyter_remote_runner --help

Project details


Download files

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

Source Distribution

jupyter_remote_runner-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

jupyter_remote_runner-0.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_remote_runner-0.1.1.tar.gz.

File metadata

  • Download URL: jupyter_remote_runner-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.0 Windows/11

File hashes

Hashes for jupyter_remote_runner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 85b8f64501648ed5cdd02c3e65c3d5da1d834ac7a6963e5a5df40929d5f3b841
MD5 dc23388decf11793078192c7bdaa75d5
BLAKE2b-256 1df3171ad814eb5f1643a7393e88bfae22ae71ffd923b4a0e2739f03f87e504d

See more details on using hashes here.

File details

Details for the file jupyter_remote_runner-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_remote_runner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cde2de1a84048253000d78ef43dee1ab4618cf23ffca41838708a8c7f43b12a3
MD5 8f8876eddfdefebe94aa5d0846bc6d8d
BLAKE2b-256 be4c6ef5e6903b46f716f8396bac534ca594d2f5528e8b5007e5a11adb9b40c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page