aiffel-jupyter-kernel
v0.0.17
Published
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Downloads
24
Readme
aiffel-jupyter-kernel
Get Started
Installation
$ yarn add aiffel-jupyter-kernel
Connect to jupyter
const connector = new KernelConnector()
connector.connect({
baseUrl: 'http://127.0.0.1:8888', // Jupyter url
token: 'token' // Jupyter token
})
Execute code
const response = connector.requestExecute({
code: value || '',
allow_stdin: true,
silent: false,
stop_on_error: true,
store_history: true,
})
Render execution response
<CodeExecuteResponse response={response} />
KernelConnector hook
type Props = {
connector: KernelConnector
}
/*
This component will be rendered when the KernelConnector's runningStatus or connectionState changes.
*/
export default function Something({ connector }: Props) {
const { runningStatus, connectionState } = useKernelConnector(connector)
...
}
Debug window
- add
DEBUG_JUPYTER_KERNEL
to localStorage - render
<DebugWindow kernelConnector={connector}/>
When develop this package
scripts
$ yarn watch
$ cd ./example
$ yarn start
Reference
- jupyterlab github: https://github.com/jupyterlab/jupyterlab
- jupyterlab package들로 제작된 jupyter연결 예제: https://github.com/jupyterlab/jupyterlab/tree/master/packages/services/examples/browser
- monaco editor: https://github.com/microsoft/monaco-editor
- monaco editor react: https://github.com/suren-atoyan/monaco-react