marimo
Use metaframe-js widgets in marimo notebooks with reactive bindings.
Installation
bash
pip install metaframe-widgetBasic usage
Wrap the widget with mo.ui.anywidget() to get reactive bindings:
python
import marimo as mo
from metaframe_widget import MetaframeWidget
w = mo.ui.anywidget(MetaframeWidget(url="https://js.mtfm.io/"))
wThen in a separate cell, w.outputs will reactively update when the metaframe emits output — any cell referencing it re-runs automatically.
python
w.set_inputs({"data": [1, 2, 3]})Piping widgets
For piping, access the underlying widget via .widget:
python
source.widget.pipe_to(sink.widget, output_key="result", input_key="data")See examples/marimo/demo.py in the repo for a complete example.
Developer guide
Running locally with Docker
bash
just marimo-dockerOpen http://localhost:2718 in your browser.
To use a different port:
bash
MARIMO_PORT=3000 just marimo-dockerRunning locally without Docker
bash
pip install -e "python/[dev]"
pip install -e "examples/marimo[dev]"
marimo edit examples/marimo/demo.pyPublishing
The widget is published from the canonical python/ directory:
bash
just build-python # builds python/dist/
just publish-python # publishes to PyPIOr via git tag for CI: git tag python-v0.1.0 && git push origin python-v0.1.0