Advanced usage

This section is aimed at Python dabblers and hackers who want to get into the more involved features of Shoebot.

Using Shoebot as a Python module

Shoebot can be easily loaded as a module inside a Python script.

import shoebot

# set up a canvas
bot = shoebot.create_bot(outputfile="output.svg")

# size() needs to be called first

# now we can draw!

# finish() should be called after all drawing commands

Take a snapshot of the current state:


Run a Shoebot/Nodebox script:"")

Running in Jupyter

[Jupyter notebooks]( are fantastic, and Shoebot runs pretty well inside them!

First, you need to have Jupyter installed, as well as the development version of Shoebot. Using virtualenvwrapper for this is heavily recommended.

# create the virtualenv
mkvirtualenv jupytershoebot
# install jupyter dependencies
pip install jupyter jupyter-pip
# clone the Shoebot repository, enter it and install
git clone
cd shoebot
python install

After ensuring both packages are available, install the extension after cloning the [jupyter-shoebot]( repository:

# leave the shoebot/ dir
cd ..
# clone the jupyter-shoebot repository, enter it and install
git clone
cd jupyter-shoebot
python install

And finally, while still on the jupyter-shoebot/ directory, run

jupyter kernelspec install shoebot_kernel --sys-prefix

All done! Now you can run jupyter notebook, go to the Kernel menu, select Change kernel and select Shoebot.

Be sure to try the [notebook examples]( in the Jupyter Shoebot repository.

Running with PyPy

To get better performance, you can run Shoebot using PyPy, which is experimental.

When installing Shoebot, you have to point to PyPy when creating your virtualenv. Instead of the first command in the Virtualenvwrapper install example, do:

mkvirtualenv shoebot -p `which pypy`

For the plain virtualenv approach, try:

virtualenv .env -p `which pypy`

Using with Django

See the shoebot-django for an example of integrating Shoebot into a Django application.

Shoebox Virtual Machine

Shoebox is a ready-to-use VirtualBox image that we use for Shoebot workshops. It’s a lightweight Xubuntu-based system, with some components stripped for size. Shoebot and its Gedit plugin are installed and working out of the box.

It is the easiest way to get non-GNU/Linux systems running Shoebot. Even for GNU/Linux systems, it’s the best choice if you don’t want to add yet another package to your system, but aren’t comfortable with virtualenvs.

To try this, Download VirtualBox, and then get the Shoebox appliance file (1.5 GB), import it into VirtualBox through File > Import Appliance, and launch your new Shoebox.