A Streamlit Component for embeding Observable Notebooks in Streamlit Apps
Project description
streamlit-observable
Embed Observable notebooks into Streamlit Apps!
Installation
pip install streamlit-observable
Usage
from streamlit_observable import observable
Embed an Entire Notebook
import streamlit as st
from streamlit_observable import observable
st.write("# Notebook Explainer")
observable("Noteo", ...)
API Reference
observable(key, notebook, targets=None, redefine={}, observe=[])
Create a new instance of "observable".
Parameters
----------
key: str
A unique string used to avoid constant re-renders to the iframe.
notebook: str
The observablehq.com notebook id to embed. Ex. "@"d3/bar-chart"
or "d/1f434ef3b0569a00"
targets: list or None
An optional list of strings that are the name of the cells to embed.
By default, the entire notebook, including unnamed cells, will be embeded.
observe: list or None
An optional list of strings that are the name of cells to observe.
Whenever these cells change value or become fulfilled, the value will
be passed back into Streamlit as part of the return value.
redefine: dict or None
An optional dict containing the cells you wish to redefine and the values
you wish to redefine them as. The keys are the cell names you want to
redefine, the values are what they will be redefined as. Keep in mind,
there is a serialization process from Streamlit Python -> frontend JavaScript.
Returns
-------
dict
An object containing the live observed values. If the observe parameter is
empty, then the dict will be empty. The keys are the name of the cell that
is observe, the values are the values of the cells.
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
Built Distribution
Close
Hashes for streamlit-observable-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a685bf0260fde836cbe40a6cbc8143b25319e1362f8e925e318de298884af56a |
|
MD5 | e264f4e5ecb713ef15549e9df23c3653 |
|
BLAKE2b-256 | 01647e567505dfb1bbfe6568f6a7ba64bc29cda006b4de47dd1de0515f86223e |
Close
Hashes for streamlit_observable-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 182f1f224a1c0a192cd64639e3915883805d4b185b59c25b07b9bc991155016f |
|
MD5 | 35ddcfc044ce9fc10e2979ad4af368f1 |
|
BLAKE2b-256 | 6a08d26a66e2e250e51ff037820f2a3d8ef6266b5c909e540c1164934113621b |