Skip to content

MatthewAndreTaylor/ipysketch_lite

Repository files navigation

ipysketch_lite

A lite sketching utility for python notebooks, no sockets or extra dependencies 🎨

(no extra widget code)

Make sketches right in your notebook then use the sketch in your python code.

Try yourself:

jupyterlite badge

demo

PyPI Docs

Quickstart

To get started pip install the extension from PyPI

This can be done using pip for jupyter environments

pip install ipysketch-lite

Or using piplite if you are using jupyter lite

import piplite
await piplite.install("ipysketch_lite[extra]") # install the package and optionally pillow and numpy for the extra features

Start drawing a quick sketch in your notebook like this

from ipysketch_lite import Sketch

sketch = Sketch()

Then add a new cell to retrieve the sketch in python

sketch.data # Sketch image data as a base64 encoded string
import matplotlib.pyplot as plt

# Plot the sketch image or do image manipulation
plt.imshow(sketch.image)
plt.show()

example sketch

Sketches get updated in cells after draw updates

This means you can continue your sketch and get the new updated outputs