Skip to content

jsteinshouer/cfml-jupyter-kernel

Repository files navigation

Jupyter Kernel for CFML

This a Jupyter Kernel for CFML powered by the CommandBox REPL. It should work on Window, Linux, and MacOS but I have not done extensive testing on them. You can also try it out on mybinder.org.

It is based on the concept of a Python wrapper kernel. It is a work it progress so likley has some functionality missing that other Kernels may provide. I am new to Python so there are probably a lot of things that can be improved here.

Requirements

Python

If you want to run it locally you will need to have Python installed. I installed it on Windows using the Chocolatey package manager.

choco install python

CommandBox

You will also need to make sure CommandBox is installed and in the system path.

Jupyter

You will need to have Jupyter installed or you can also use the VS Code Jupyter notebook extension.

Docker

You can also run it with Docker if you do not want to mess around with installing dependencies. There is a docker image associated with the repository that can be utilized for running it was well. See the other options below.

Install Kernel

pip install cfml-jupyter
python -m cfml_kernel.cfscript.install
python -m cfml_kernel.cfml.install

If you want to develop on the Kernel you can clone it and install it this way. Adding the -e flag to make it editable.

git clone https://github.com/jsteinshouer/cfml-jupyter-kernel.git
pip install -e ./cfml-jupyter-kernel
python -m cfml_kernel.cfscript.install
python -m cfml_kernel.cfml.install

Run it

I prefer to use the VS Code Jupyter notebook extension to run my notebooks. Here is a blog post that explains how to set that up.

You can also run it the traditional way, if you installed Jupyter, using this command:

jupyter notebook

Run on mybinder.org

You can try it out and create CFML notebooks using this link:

Binder

Github Codespaces / Dev Container

You can fork this repo and run it with Github Codespaces or clone the repo and run it locally with the VS Code Dev Containers extension.

Running locally with Docker

If you have cloned the repo you can just use docker compose to run it.

docker compose up

Go to http://127.0.0.1:8888/lab?token=123 to access the Jupyter Lab application.

However there is a pre-built image you can use instead. This will run the Jupyter lab application using the pre-built image.

docker run -v ${PWD}:/home/jovyan/work -p 8888:8888 -e JUPYTER_TOKEN=123 ghcr.io/jsteinshouer/cfml-jupyter:latest