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.0.tar.gz (7.0 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.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_remote_runner-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 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.0.tar.gz
Algorithm Hash digest
SHA256 40fa12f145a8fdd3106e3bb8516ea3bceb6c2116f715d1b65ce923df05208db5
MD5 2be4e202a6c07a47a492be5e1940096b
BLAKE2b-256 faf6aad5cee8fa2ff388a959f5623c5e7d52f4a8eb5a8e0f4ed17702ea012d55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyter_remote_runner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d41fa8cf6e2cf124a63f0751e4e46af30349b90d282c66c5a8316e51244c4877
MD5 5d28c1868eb5ead3a9ee29259f51e9de
BLAKE2b-256 3d8dd399b5150b9c7cb76f79fa0d9917af8be655329d44e8f59b13bf0a40231d

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