Skip to main content

Collection of Anywidget Widgets

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modraw-0.1.14.tar.gz (589.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modraw-0.1.14-py3-none-any.whl (590.1 kB view details)

Uploaded Python 3

File details

Details for the file modraw-0.1.14.tar.gz.

File metadata

  • Download URL: modraw-0.1.14.tar.gz
  • Upload date:
  • Size: 589.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.7

File hashes

Hashes for modraw-0.1.14.tar.gz
Algorithm Hash digest
SHA256 1e70d09892d1be2c7633b5eea74c57e0675c6688275391007b3206d3fe457dc7
MD5 3fc3716cd7ecf43f6679150040e9258f
BLAKE2b-256 b82ae8a8525e5a302cf949efbc811b2190277360f794bd010f80cf7e1bd57140

See more details on using hashes here.

File details

Details for the file modraw-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: modraw-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 590.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.7

File hashes

Hashes for modraw-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1b7c5a8ec9f9fa590df791cbf3ffb0d9e456880190954953fcd74650043b22
MD5 2d9ac70d1b49d2bdf483dd8bee9251ef
BLAKE2b-256 ef4ea06fedf909ff9461375f443669d5320963ea3eeb1038aefcc11739998fb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page