Skip to content

mpcjanssen/tcljupyter

Repository files navigation

Installation

local

  • [TODO] add script for local build for now see Dockerfile
  • Manually copy the kernel.json to a subdirectory of the kernels directory in a Jupyter data location (one of jupyter --paths).

Jupyter will use the kernel.json file to start the kernel (passing the connection file as the first parameter).

Docker

The docker folders contains a Dockerfile for building a tcljupyter container based on alpine. An example docker-compose.yml files is provided.

Prebuilt images for amd64 and arm64 are on Docker Hub.

Dependencies

The Tcl used to run the init.tcl script should have the following available:

  • Tcl 8.6 or higer with threads and sqlite
  • tclzmq (Not for the tclonly version)
  • tcllib uuid
  • tcllib sha256

Build tclzmq on windows

Easiest way to build tclzmq on Windows is to use mingw.

  • Install tcllib
  • Install critcl
  • Install the msys zmq packages
pacman -Syu mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-zeromq
  • Run the build.tcl installer from the tclzmq distro. NB: Static builds don't work in the sense that they are the same as shared builds.

Supported

Most web client commands are supported. Only thing missing is reading from stdin with for example gets.

Commands

  • jupyter::display mimetype body: Display body in the cell. Returns the display id for use in updatedisplay.
  • jupyter::html body: Display body as html in the cell. Returns the display id for use in updatedisplay.
  • jupyter::updatedisplay id mimetype body: Updates the display with id id with then new body.
  • jupyter::updatehtml id body: Updates the html display with id id with the new body.

Magic commands

Magics are lines starting with %% at the top of the cell.

  • ##timeit ?count?: Time the execution of the cell and display the results. Changing count will execute the cell multiple times and show the average time.
  • ##noresult: Do not show the last result. This is convenient if the last result is very large. The same effect can be achieved by appending ; to the last command of the cell.

Test suite

A prequisite is the jupyter_kernel_test (JKT) module:

pip install jupyter_kernel_test

To run the test suite, execute (from within the checkout directory):

python -m tests.test_tcljupyter

Design

Design

For communication from kernel to session thread [thread::send -async] is being used. stdout and stderr are being intercepted by chan push

About

Tcl kernel for Jupyter

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •