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://js.mtfm.io/#?js=...", height="300px")
w
marimo
import marimo as mo
from metaframe_widget import MetaframeWidget
w = MetaframeWidget(url="https://js.mtfm.io/#?js=...", height="300px")
mo.ui.anywidget(w)
Create from inline JavaScript
w = MetaframeWidget.from_code("""
setOutput("result", getInput("data") * 2);
""", height="300px")
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 changesfrom_code(js_code, **kwargs)— class method to create a widget from inline JSpipe_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.3.tar.gz.
File metadata
- Download URL: metaframe_widget-0.3.3.tar.gz
- Upload date:
- Size: 4.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 |
6e153b4b4c4dd8641d5cacd2f0268b46ddc89fd6714152d81ca09446d26ceedb
|
|
| MD5 |
55d14caf97175bc74179e26964203f56
|
|
| BLAKE2b-256 |
98082b066f033e535ca70379ed59512c0291217a295051e6705a3b073d43680e
|
Provenance
The following attestation bundles were made for metaframe_widget-0.3.3.tar.gz:
Publisher:
publish-python.yml on metapages/metaframe-js
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaframe_widget-0.3.3.tar.gz -
Subject digest:
6e153b4b4c4dd8641d5cacd2f0268b46ddc89fd6714152d81ca09446d26ceedb - Sigstore transparency entry: 1411671651
- Sigstore integration time:
-
Permalink:
metapages/metaframe-js@9bbbead649eefda3961cc5820055bb8704865cc1 -
Branch / Tag:
refs/tags/python-v0.3.3 - Owner: https://github.com/metapages
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@9bbbead649eefda3961cc5820055bb8704865cc1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaframe_widget-0.3.3-py3-none-any.whl.
File metadata
- Download URL: metaframe_widget-0.3.3-py3-none-any.whl
- Upload date:
- Size: 5.5 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 |
bfd980b5ecadc40a89e401e965d58c9be6430cdb345fb3fe7232dc2391772470
|
|
| MD5 |
a2f483f36655a918c3e6678ca441549f
|
|
| BLAKE2b-256 |
3aad926b5882a78586d47156b7a845409173afd11a1de40f2c2f2a74bee874f2
|
Provenance
The following attestation bundles were made for metaframe_widget-0.3.3-py3-none-any.whl:
Publisher:
publish-python.yml on metapages/metaframe-js
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaframe_widget-0.3.3-py3-none-any.whl -
Subject digest:
bfd980b5ecadc40a89e401e965d58c9be6430cdb345fb3fe7232dc2391772470 - Sigstore transparency entry: 1411671754
- Sigstore integration time:
-
Permalink:
metapages/metaframe-js@9bbbead649eefda3961cc5820055bb8704865cc1 -
Branch / Tag:
refs/tags/python-v0.3.3 - Owner: https://github.com/metapages
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@9bbbead649eefda3961cc5820055bb8704865cc1 -
Trigger Event:
push
-
Statement type: