Skip to main content

Simple Python package to preview and develop streamlit apps in jupyter notebooks

Project description

streamlit-jupyter

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 Function decorator to memoize function executions.
st.caption Display text in small font.
st.checkbox Display a checkbox widget.
st.code Display a code block with optional syntax highlighting.
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.experimental_data_editor Display a data editor widget.
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.

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

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

streamlit-jupyter-0.2.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

streamlit_jupyter-0.2.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file streamlit-jupyter-0.2.1.tar.gz.

File metadata

  • Download URL: streamlit-jupyter-0.2.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for streamlit-jupyter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 528f1f59f49bbcc324549ac462f7d7a5a7076b025cecb8c85cd789392d2cd855
MD5 5658f3af05732b41e2b277237f86027d
BLAKE2b-256 771c87ea92628194317cb0041f4cf101d3bd2eaafde66d6f2170ad5bcbb9329e

See more details on using hashes here.

File details

Details for the file streamlit_jupyter-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_jupyter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32742bcf13702d2ab16e981ad72cdc53e0482dcde0e96cacfeecb8015d8c72ef
MD5 6f645f709837121e0f72eb4d8f4b46f0
BLAKE2b-256 a85866f78a4251217a82f805d9c93574fde800a7be288fca5635ad85a1d87cc9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page