A monorepo containing jupyter-blocks and jupyter-tidyblocks. Blockly extension for JupyterLab.
TypeScript 82.6%
Python 5.3%
JavaScript 1.0%
Shell 0.9%
Batchfile 0.5%
Makefile 0.4%
CSS 0.2%
Other 9.1%
276 1 0

Clone this repository

https://tangled.org/teonbrooks.com/jupyter-blocks https://tangled.org/did:plc:yl7wcldipsfnjdww2jg5mnrv/jupyter-blocks
git@tangled.org:teonbrooks.com/jupyter-blocks git@tangled.org:did:plc:yl7wcldipsfnjdww2jg5mnrv/jupyter-blocks

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
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.