Expand description
Easy Jupyter Client for your Language
ⓘ
use clap::Parser;
use clap_derive::{Parser, Subcommand};
use jupyter::{InstallAction, JupyterResult, OpenAction, StartAction, UninstallAction};
use std::path::PathBuf;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
pub struct JupyterApplication {
/// Sets a custom config file
#[arg(short, long, value_name = "FILE")]
config: Option<PathBuf>,
/// Turn debugging information on
#[arg(short, long, action = clap::ArgAction::Count)]
debug: u8,
#[command(subcommand)]
command: JupyterCommands,
}
#[derive(Subcommand)]
enum JupyterCommands {
Open(Box<OpenAction>),
Start(Box<StartAction>),
Install(Box<InstallAction>),
Uninstall(Box<UninstallAction>),
}
impl JupyterApplication {
pub fn run(&self) -> JupyterResult<()> {
match &self.command {
JupyterCommands::Open(v) => v.run(),
JupyterCommands::Start(v) => v.run(),
JupyterCommands::Install(v) => v.run(),
JupyterCommands::Uninstall(v) => v.run(),
}
}
}
fn main() -> JupyterResult<()> {
let app = JupyterApplication::parse();
app.run()
}
Modules
- Some helpful value types for Jupyter Kernel Protocol.
Structs
- The request to execute code
- The request to execute code
- The result of executing code
- To install/overwrite a new kernel to jupyter.
- Indicates successful establishment of link with jupyter frontend
- The error type for Jupyter.
- The sockets for Jupyter kernel.
- Represent a message from jupyter client
- Represents a stream via standard output
- The language information and abilities provided by the kernel
- Open the jupyter-lab application for debug.
- To start a jupyter kernel for language.
- Send values to the associated
UnboundedReceiver
. - Uninstall the jupyter kernel of language.
Enums
- ExecutionPayloadDeprecatedThe result of executing code
- The error kind for Jupyter.
- Represents any valid JSON value.
Traits
- A executed result that can be render in jupyter notebook.
- The protocol of the kernel
- A data structure that can be serialized into any data format supported by Serde.
Functions
- Convert a
T
intoserde_json::Value
which is an enum that can represent any valid JSON data.
Type Aliases
- The result type for Jupyter.