Skip to main content

modraw

"A collection of tldraw based anywidgets for marimo, but also other Python notebooks."

The project uses anywidget under the hood so our tools should work in Marimo but also Jupyter, Shiny for Python, VSCode, Colab, Solara and Marimo. Because of the anywidget integration you should also be able interact with ipywidgets natively.

Online demos

Check Github pages for a live demo.

Installation

Installation occurs via pip or uv.

python -m pip install modraw
uv pip install modraw

Usage

Draw

The main widget that's available in this library is the Draw widget. This generates a ltdraw widget and you're able to retreive the drawn image in a base64 representation or as a Python image object.

import marimo as mo
from modraw import Draw

widget = mo.ui.anywidget(Draw())
widget
# Fetch the doodle and put it in Python
widget.get_base64()
widget.get_pil()

Related project

This isn't the only tldraw integration with Python, you might also be interested in jupyter-tldraw. It's a neat project for sure, and the main difference is that this project tries to target marimo more directly and can also move a bit faster with that in mind. I'm currently employed at marimo, so having a tool that I can easily change is very useful.

Development

I am currently exploring how we might move some of these components to react, mainly in an attempt to keep things flexible in the future. There's no need to port everything just yet but I have ported the clipboard button. You should be able to develop it via:

make install
make dev

Metadata

Release files for modraw 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modraw 0.1.14
File Size Uploaded
modraw-0.1.14.tar.gz 589.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for modraw 0.1.14
File Interpreter ABI Platform
modraw-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / modraw-0.1.14.tar.gz

Download URL modraw-0.1.14.tar.gz
Size 589.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1e70d09892d1be2c7633b5eea74c57e0675c6688275391007b3206d3fe457dc7
BLAKE2b-256 checksum
How to use checksums
b82ae8a8525e5a302cf949efbc811b2190277360f794bd010f80cf7e1bd57140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.7

Release files / modraw-0.1.14-py3-none-any.whl

Download URL modraw-0.1.14-py3-none-any.whl
Size 590.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e1b7c5a8ec9f9fa590df791cbf3ffb0d9e456880190954953fcd74650043b22
BLAKE2b-256 checksum
How to use checksums
ef4ea06fedf909ff9461375f443669d5320963ea3eeb1038aefcc11739998fb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.7

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page