1 unstable release

Uses old Rust 2015

0.1.0 Dec 5, 2018

#22 in #jupyter

Apache-2.0

405KB
8K SLoC

Python 5.5K SLoC // 0.3% comments Rust 2K SLoC // 0.1% comments Batch 227 SLoC // 0.0% comments Forge Config 6 SLoC Shell 4 SLoC

Rust Jupyter Client

pipeline status

Development documentation

A new interface for running interactive python code.

Installation

Add the following to your Cargo.toml:

[dependencies]
jupyter-client = { git = "https://gitlab.com/srwalker101/rust-jupyter-client.git", branch = "dev" }

lib.rs:

Jupyter Client

A Rust implementation of the Jupyter client.

Examples

extern crate jupyter_client;

use jupyter_client::Client;
use jupyter_client::commands::Command;

let client = Client::existing()?;

// Set up the heartbeat watcher
let hb_receiver = client.heartbeat()?;
thread::spawn(move || {
for _ in hb_receiver {
println!("Received heartbeat from kernel");
}
});

// Spawn an IOPub watcher
let receiver = client.iopub_subscribe()?;
thread::spawn(move || {
for msg in receiver {
println!("Received message from kernel: {:#?}", msg);
}
});

// Command to run
let command = Command::Execute {
code: "a = 10".to_string(),
silent: false,
store_history: true,
user_expressions: HashMap::new(),
allow_stdin: true,
stop_on_error: false,
};

// Run some code on the kernel
let response = client.send_shell_command(command)?;

Dependencies

~3.5–5MB
~91K SLoC