anywidget for embedding metaframe URLs in Jupyter and marimo notebooks
Project description
metaframe-widget
An anywidget for embedding metaframe and metapage URLs in Jupyter and marimo notebooks.
Install
pip install metaframe-widget
With environment extras:
pip install "metaframe-widget[jupyter]" # includes jupyterlab
pip install "metaframe-widget[marimo]" # includes marimo
Quick start
Jupyter
from metaframe_widget import MetaframeWidget
w = MetaframeWidget(url="https://framejs.io/#?js=...", height="300px")
w
marimo
import marimo as mo
from metaframe_widget import MetaframeWidget
w = MetaframeWidget(url="https://framejs.io/#?js=...", height="300px")
mo.ui.anywidget(w)
A widget is always created from a URL. To embed your own code, build and save it
at framejs.io — the editor mints a short URL you can paste
into url=. The URL is the portable, saveable form of a metaframe; the code
itself lives behind it rather than being inlined in your notebook.
API reference
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
str |
"" |
Full metaframe URL (including hash params) |
inputs |
dict |
{} |
Dict of inputs to push to the metaframe |
outputs |
dict |
{} |
Dict of outputs received from the metaframe (read-only) |
width |
str |
"100%" |
CSS width for the widget container |
height |
str |
"400px" |
CSS height for the widget container |
allow |
str |
"" |
iframe allow attribute (e.g. "camera; microphone") |
Methods
set_inputs(d)— merge a dict into current inputsset_input(key, value)— set a single input keyon_outputs_change(callback)— register a callback for output changeson_saved_url_change(callback)— register a callback for when the user creates an expiring snapshot (/j/<sha256>) inside the widgetpipe_to(target, output_key, input_key=None)— connect an output to another widget's input
Piping widgets
source = MetaframeWidget(url="...")
sink = MetaframeWidget(url="...")
source.pipe_to(sink, output_key="result", input_key="data")
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaframe_widget-0.3.11.tar.gz.
File metadata
- Download URL: metaframe_widget-0.3.11.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376cd7d3ad2bc667936d7dbdcf58df98e836da753db0483abd609dd5878268f0
|
|
| MD5 |
ade704347153fcb046fa1db5a6b6c91d
|
|
| BLAKE2b-256 |
84f1c9775a82daa74b4fc589ee34b92b30d705370a45c84df03a736f58ccb87f
|
Provenance
The following attestation bundles were made for metaframe_widget-0.3.11.tar.gz:
Publisher:
publish-python.yml on metapages/framejs.io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaframe_widget-0.3.11.tar.gz -
Subject digest:
376cd7d3ad2bc667936d7dbdcf58df98e836da753db0483abd609dd5878268f0 - Sigstore transparency entry: 2170127836
- Sigstore integration time:
-
Permalink:
metapages/framejs.io@80b4e5c30f8c19f313fb488743fae33f3298b42a -
Branch / Tag:
refs/tags/python-v0.3.11 - Owner: https://github.com/metapages
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@80b4e5c30f8c19f313fb488743fae33f3298b42a -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaframe_widget-0.3.11-py3-none-any.whl.
File metadata
- Download URL: metaframe_widget-0.3.11-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ba0989ec20953810eb321e507e59ab07932efb87773759cc1839c1df82722f5
|
|
| MD5 |
401c929517767c253a2924659e7bdda5
|
|
| BLAKE2b-256 |
7cfcd38563ad20780b293cbaa2657f0b2c8448c630a2600c907ea959a2aaa46a
|
Provenance
The following attestation bundles were made for metaframe_widget-0.3.11-py3-none-any.whl:
Publisher:
publish-python.yml on metapages/framejs.io
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaframe_widget-0.3.11-py3-none-any.whl -
Subject digest:
2ba0989ec20953810eb321e507e59ab07932efb87773759cc1839c1df82722f5 - Sigstore transparency entry: 2170127841
- Sigstore integration time:
-
Permalink:
metapages/framejs.io@80b4e5c30f8c19f313fb488743fae33f3298b42a -
Branch / Tag:
refs/tags/python-v0.3.11 - Owner: https://github.com/metapages
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@80b4e5c30f8c19f313fb488743fae33f3298b42a -
Trigger Event:
push
-
Statement type: