Skip to main content

streamlit-jupyter

CI Badge Open Streamlit App

Docs & links

Install

pip install streamlit_jupyter

How to use

Take a look at our example notebook, streamlit version runs here

The main idea is for you do experiment and develop in your notebook, visually see all the pieces, and then convert the notebook to .py to be run by streamlit

start by importing streamlit and patching it with streamlit-jupyter:

import streamlit as st

from streamlit_jupyter import StreamlitPatcher, tqdm

StreamlitPatcher().jupyter()  # register streamlit with jupyter-compatible wrappers

And now develop your notebook as usual, but with the ability to use Streamlit widgets and components.

See how it works below, and check out the example notebook

Currently supported methods

Refer to excellent streamlit docs for more details on each method

method docstring
st.cache_data Implements the public st.cache_data API: the @st.cache_data decorator, and
st.cache_resource Implements the public st.cache_resource API: the @st.cache_resource decorator,
st.cache Legacy caching decorator (deprecated).
st.caption Display text in small font.
st.checkbox Display a checkbox widget.
st.code Display a code block with optional syntax highlighting.
st.data_editor Display a data editor widget.
st.dataframe Display a dataframe as an interactive table.
st.date_input Display a date input widget.
st.expander Insert a multi-element container that can be expanded/collapsed.
st.header Display text in header formatting.
st.json Display object or string as a pretty-printed JSON string.
st.latex Display mathematical expressions formatted as LaTeX.
st.markdown Display string formatted as Markdown.
st.metric Display a metric in big bold font, with an optional indicator of how the metric changed.
st.multiselect Display a multiselect widget.
st.radio Display a radio button widget.
st.selectbox Display a select widget.
st.subheader Display text in subheader formatting.
st.text_area Display a multi-line text input widget.
st.text_input Display a single-line text input widget.
st.text Write fixed-width and preformatted text.
st.title Display text in title formatting.
st.write Write arguments to the app.

Currently unsupported methods

Most of the other methods are not supported yet.

If you need any of them, you have one of 2 options:

  • please open an issue or a PR

  • use them in your notebook regardless, they will still work once you convert your notebook to streamlit. You just won’t be able to preview them in jupyter.

How to contribute

To start with you need to create virtualenv with pipenv tool and the libraries from Pipfile:

pipenv shell 
pipenv install -d 

Install quatro, if you have Mac OS use homebrew:

brew install quarto

otherwise, check https://quarto.org/docs/download/

The next step is to install streamlit-jupyter from the repo

pip install -e "[dev]"

now you are all set, you can refer to Makefile to see examples with streamlit-jupyter. Simply run a command:

make all

Demonstration

Jupyter Streamlit
Markdown and headings alt alt
Interactive data entry alt alt
Pick and choose alt alt
Dataframes, caching and progress bars alt alt
Plots alt alt
Metrics alt alt

Release files for streamlit-jupyter 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-jupyter 0.3.1
File Size Uploaded
streamlit_jupyter-0.3.1.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-jupyter 0.3.1
File Interpreter ABI Platform
streamlit_jupyter-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / streamlit_jupyter-0.3.1.tar.gz

Download URL streamlit_jupyter-0.3.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
df18e09326925c931987d80ce100832b241c2e759250c749fcff71c7941abb38
BLAKE2b-256 checksum
How to use checksums
eedaa47e9530b5868baa4b266e2c3097d37f8d461def358291b60c2c30eacb4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / streamlit_jupyter-0.3.1-py3-none-any.whl

Download URL streamlit_jupyter-0.3.1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c84a8f0c0b6f9265a0d933dd3a83a80aeb382793810ed44f38c1748362d2f52
BLAKE2b-256 checksum
How to use checksums
97603bd1852e23399eb4c6702e0d8881997ca7074732fa0da345482b1d134ba7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page