A monorepo containing jupyter-blocks and jupyter-tidyblocks. Blockly extension for JupyterLab.
TypeScript 83%
9%
Python 5%
JavaScript <1%
Shell <1%
Batchfile <1%
Makefile <1%
CSS <1%

README.md

jupyter-blocks #

Github Actions Status

A monorepo containing two independently installable JupyterLab extensions:

  • jupyter-blocks — a generic Google Blockly editor for JupyterLab. Opens .jblk files, runs the generated code in a kernel, and exposes IBlocklyRegistry so other extensions can add their own toolboxes, blocks, and generators.

  • jupyter-tidyblocks — a tidy-data analysis layer on top of jupyter-blocks. Inspired by Greg Wilson's tidyblocks and originally built on QuantStack/jupyterlab-blockly. Provides drag-and-drop pandas pipelines (filter, select, group, join, plot, …) that generate executable Python.

Install #

Tidy-data analysis (installs both packages) #

pip install jupyter-tidyblocks

or via conda-forge (once published):

conda install -c conda-forge jupyter-tidyblocks

Generic Blockly editor only #

pip install jupyter-blocks

Supported kernels #

Uninstall #

pip uninstall jupyter-tidyblocks   # also removes jupyter-blocks if unused
pip uninstall jupyter-blocks

Contributing #

Development install #

conda create -n blocks -c conda-forge python nodejs pre-commit jupyterlab ipykernel
conda activate blocks

git clone https://github.com/teonbrooks/jupyter-blocks
cd jupyter-blocks

pre-commit install
npm install
npm run build

# Install Python packages in editable mode
pip install -e ./jupyter_blocks
pip install -e ./jupyter_tidyblocks

# Register labextensions for development
jupyter labextension develop ./jupyter_blocks --overwrite
jupyter labextension develop ./jupyter_tidyblocks --overwrite

Watch mode (two terminals):

# Terminal 1 — rebuild on source changes
npm run watch

# Terminal 2 — run JupyterLab
jupyter lab

Development uninstall #

pip uninstall jupyter-tidyblocks jupyter-blocks

Remove the symlinks created by jupyter labextension develop:

jupyter labextension list   # find labextensions folder
# remove jupyter-blocks-extension and jupyter-tidyblocks-extension symlinks

Packaging #

See RELEASE.md.