https://github.com/nteract/spawnteract
:children_crossing: Spawn Jupyter Kernels
https://github.com/nteract/spawnteract
jupyter jupyter-kernels nteract
Last synced: 2 months ago
JSON representation
:children_crossing: Spawn Jupyter Kernels
- Host: GitHub
- URL: https://github.com/nteract/spawnteract
- Owner: nteract
- Created: 2016-01-22T04:37:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T00:40:28.000Z (over 2 years ago)
- Last Synced: 2025-04-01T12:04:23.535Z (3 months ago)
- Topics: jupyter, jupyter-kernels, nteract
- Language: JavaScript
- Homepage:
- Size: 1.69 MB
- Stars: 15
- Watchers: 35
- Forks: 15
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Spawnteract
Spawn yourself a Jupyter kernel backend.
```
npm install --save spawnteract
```## Usage
```javascript
const spawnteract = require('spawnteract')spawnteract.launch('python3').then(kernel => {
// Returns
// kernel.spawn <-- The running process, from child_process.spawn(...)
// kernel.connectionFile <-- Connection file path
// kernel.config <-- Connection information from the file// Print the ip address and port for the shell channel
console.log(kernel.config.ip + ':' + kernel.config.shell_port);
})
````spawnteract` will automatically delete the connection file after the kernel
process exits or errors out.To disable this feature, set `cleanupConnectionFile` to `false` in the `spawnOptions`:
```js
launch(kernelName, { cleanupConnectionFile: false });
```You'll should close `kernel.spawn` when a user shuts down the kernel. If you disabled automatic cleanup, you will need to delete `kernel.connectionFile` from disk when finished:
```js
function cleanup(kernel) {
kernel.spawn.kill();
// Only do this second part if you opted out of automatic cleanup:
fs.unlink(kernel.connectionFile);
}
```*For more info, see our [changelog](https://github.com/nteract/spawnteract/blob/master/CHANGELOG.md)
or open an issue with questions*You will probably end up wanting to use this with [enchannel-zmq-backend](https://github.com/nteract/enchannel-zmq-backend).