Skip to content

A tool for interacting with Jupyter kernels

Notifications You must be signed in to change notification settings

isabella232/jupyter-session

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jupyter-session

Broken out of Hydrogen.

This API is not finalized.

Usage

var Session = require('jupyter-session');

pythonSession = new Session(
    {
        version: 5,
        signature_scheme: 'sha256',
        key: '<the signing key>',
        transport: 'tcp',
        ip: '127.0.0.1',
        hb_port: 60868,
        control_port: 60869,
        shell_port: 60870,
        stdin_port: 60871,
        iopub_port: 60872
    },
    <'handle to kernel process, if available'>
);

// use wildcards to get all messages on a channel
pythonSession.on('shell.*', function(message) {
    // message will be a jmp.Message
});

pythonSession.execute(code, function(results) {
    // results will be a jmp.Message

    // this function may be called several times
    // as additional messages come in from the kernel
});

pythonSession.complete(code, function(results) {
    // results will be a jmp.Message
});

Session is an EventEmitter, so you can use any of these methods: https://github.com/asyncly/EventEmitter2

About

A tool for interacting with Jupyter kernels

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 100.0%