diff --git a/python/api-examples-source/charts.video3/requirements.txt b/python/api-examples-source/charts.video3/requirements.txt index 1074067da..56c37dfb1 100644 --- a/python/api-examples-source/charts.video3/requirements.txt +++ b/python/api-examples-source/charts.video3/requirements.txt @@ -1,2 +1,2 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 webvtt-py \ No newline at end of file diff --git a/python/api-examples-source/data.audio_column.py b/python/api-examples-source/data.audio_column.py new file mode 100644 index 000000000..a4f9b3e23 --- /dev/null +++ b/python/api-examples-source/data.audio_column.py @@ -0,0 +1,48 @@ +import base64 +import pandas as pd +import streamlit as st + + +@st.cache_data +def load_audio_as_base64(): + with open("python/api-examples-source/cat-purr.mp3", "rb") as audio_file: + audio_bytes = audio_file.read() + return base64.b64encode(audio_bytes).decode("utf-8") + + +data_df = pd.DataFrame( + { + "source": [ + "Small and fluffy house panther", + "Wikimedia, Performed by Muriel Nguyen Xuan and Stéphane Magnenat", + ], + "audio": [ + f"data:audio/mp3;base64,{load_audio_as_base64()}", + "https://upload.wikimedia.org/wikipedia/commons/c/c4/Muriel-Nguyen-Xuan-Chopin-valse-opus64-1.ogg", + ], + } +) + +st.dataframe( + data_df, + column_config={ + "audio": st.column_config.AudioColumn("Preview Audio"), + }, +) + +st.caption( + """ + ##### Audio credit: + + Performer: _Muriel Nguyen Xuan_ and _Stéphane Magnenat_ + + Composer: Frédéric Chopin + + License: Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license. + https://creativecommons.org/licenses/by-sa/4.0/ + + URL: + https://upload.wikimedia.org/wikipedia/commons/c/c4/Muriel-Nguyen-Xuan-Chopin-valse-opus64-1.ogg + +""" +) diff --git a/python/api-examples-source/data.dataframe_programmatic_selections.py b/python/api-examples-source/data.dataframe_programmatic_selections.py new file mode 100644 index 000000000..ae3a816e7 --- /dev/null +++ b/python/api-examples-source/data.dataframe_programmatic_selections.py @@ -0,0 +1,23 @@ +import pandas as pd +import streamlit as st +from numpy.random import default_rng as rng + +df = pd.DataFrame( + rng(0).standard_normal((12, 5)), columns=["a", "b", "c", "d", "e"] +) + +if st.button("Select the first row"): + st.session_state.data = {"selection": {"rows": [0]}} +if st.button("Select column a"): + st.session_state.data = {"selection": {"columns": ["a"]}} +if st.button("Select the first cell of column a"): + st.session_state.data = {"selection": {"cells": [[0, "a"]]}} + +event = st.dataframe( + df, + key="data", + on_select="rerun", + selection_mode=["single-cell", "single-row", "single-column"], +) + +event.selection diff --git a/python/api-examples-source/data.table_auto_header.py b/python/api-examples-source/data.table_auto_header.py new file mode 100644 index 000000000..edf484ead --- /dev/null +++ b/python/api-examples-source/data.table_auto_header.py @@ -0,0 +1,13 @@ +import streamlit as st + +st.table( + { + ":material/folder: Project": "**Streamlit** - The fastest way to build data apps", + ":material/code: Repository": "[github.com/streamlit/streamlit](https://github.com/streamlit/streamlit)", + ":material/new_releases: Version": ":gray-badge[1.45.0]", + ":material/license: License": ":green-badge[Apache 2.0]", + ":material/group: Maintainers": ":blue-badge[Core Team] :violet-badge[Community]", + }, + border="horizontal", + width="content", +) diff --git a/python/api-examples-source/data.table_hide_header_and_index.py b/python/api-examples-source/data.table_hide_header_and_index.py new file mode 100644 index 000000000..94c7071d4 --- /dev/null +++ b/python/api-examples-source/data.table_hide_header_and_index.py @@ -0,0 +1,5 @@ +import pandas as pd +import streamlit as st + +df = pd.DataFrame({"Name": ["Alice", "Bob"], "Age": [25, 30]}) +st.table(df, hide_index=True, hide_header=True) diff --git a/python/api-examples-source/data.video_column.py b/python/api-examples-source/data.video_column.py new file mode 100644 index 000000000..2366d9e9b --- /dev/null +++ b/python/api-examples-source/data.video_column.py @@ -0,0 +1,22 @@ +import pandas as pd +import streamlit as st + +data_df = pd.DataFrame( + { + "description": [ + "Get started with Streamlit", + "Get started with Community Cloud", + ], + "video": [ + "https://s3-us-west-2.amazonaws.com/assets.streamlit.io/videos/hero-video.mp4", + "https://s3-us-west-2.amazonaws.com/assets.streamlit.io/videos/streamlit_sharing_silent.mp4", + ], + } +) + +st.dataframe( + data_df, + column_config={ + "video": st.column_config.VideoColumn("Preview Video"), + }, +) diff --git a/python/api-examples-source/guides/requirements.txt b/python/api-examples-source/guides/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/guides/requirements.txt +++ b/python/api-examples-source/guides/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/hello/requirements.txt b/python/api-examples-source/hello/requirements.txt index 1fce0cca7..b65f0436b 100644 --- a/python/api-examples-source/hello/requirements.txt +++ b/python/api-examples-source/hello/requirements.txt @@ -2,4 +2,4 @@ pandas==1.5.3 numpy==1.23.5 altair==4.2.0 pydeck==0.8.0 -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/mpa-hello/requirements.txt b/python/api-examples-source/mpa-hello/requirements.txt index 904151f9b..281bb7e5a 100644 --- a/python/api-examples-source/mpa-hello/requirements.txt +++ b/python/api-examples-source/mpa-hello/requirements.txt @@ -3,4 +3,4 @@ numpy==1.23.5 altair==4.2.0 pydeck==0.8.0 opencv-python-headless==4.8.1.78 -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/navigation.example_1/requirements.txt b/python/api-examples-source/navigation.example_1/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/navigation.example_1/requirements.txt +++ b/python/api-examples-source/navigation.example_1/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/navigation.example_2/requirements.txt b/python/api-examples-source/navigation.example_2/requirements.txt index 464451149..31c8b9196 100644 --- a/python/api-examples-source/navigation.example_2/requirements.txt +++ b/python/api-examples-source/navigation.example_2/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/api-examples-source/navigation.example_top/requirements.txt b/python/api-examples-source/navigation.example_top/requirements.txt index 464451149..31c8b9196 100644 --- a/python/api-examples-source/navigation.example_top/requirements.txt +++ b/python/api-examples-source/navigation.example_top/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/api-examples-source/requirements.txt b/python/api-examples-source/requirements.txt index bf52aa896..138990340 100644 --- a/python/api-examples-source/requirements.txt +++ b/python/api-examples-source/requirements.txt @@ -11,4 +11,4 @@ pydeck Faker openai vega_datasets -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/st-experimental-connection/1.22/st-experimental-connection/requirements.txt b/python/api-examples-source/st-experimental-connection/1.22/st-experimental-connection/requirements.txt index 09ef12a65..39386b38e 100644 --- a/python/api-examples-source/st-experimental-connection/1.22/st-experimental-connection/requirements.txt +++ b/python/api-examples-source/st-experimental-connection/1.22/st-experimental-connection/requirements.txt @@ -1,4 +1,4 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 toml sqlalchemy==1.4 duckdb diff --git a/python/api-examples-source/theming/requirements.txt b/python/api-examples-source/theming/requirements.txt index a4504b045..355f66995 100644 --- a/python/api-examples-source/theming/requirements.txt +++ b/python/api-examples-source/theming/requirements.txt @@ -1,4 +1,4 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 vega_datasets altair==4.2.0 plotly==5.13.0 \ No newline at end of file diff --git a/python/api-examples-source/tutorials/custom-navigation/requirements.txt b/python/api-examples-source/tutorials/custom-navigation/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/tutorials/custom-navigation/requirements.txt +++ b/python/api-examples-source/tutorials/custom-navigation/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/tutorials/elements/charts/requirements.txt b/python/api-examples-source/tutorials/elements/charts/requirements.txt index 0db5b4b52..8d852dba5 100644 --- a/python/api-examples-source/tutorials/elements/charts/requirements.txt +++ b/python/api-examples-source/tutorials/elements/charts/requirements.txt @@ -1,2 +1,2 @@ vega_datasets -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/api-examples-source/tutorials/elements/dataframes/requirements.txt b/python/api-examples-source/tutorials/elements/dataframes/requirements.txt index 0a78bf019..e411deb52 100644 --- a/python/api-examples-source/tutorials/elements/dataframes/requirements.txt +++ b/python/api-examples-source/tutorials/elements/dataframes/requirements.txt @@ -1,2 +1,2 @@ Faker -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/api-examples-source/tutorials/requirements.txt b/python/api-examples-source/tutorials/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/tutorials/requirements.txt +++ b/python/api-examples-source/tutorials/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/utilities.page_link_query_params/requirements.txt b/python/api-examples-source/utilities.page_link_query_params/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/utilities.page_link_query_params/requirements.txt +++ b/python/api-examples-source/utilities.page_link_query_params/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/utilities.switch_page/requirements.txt b/python/api-examples-source/utilities.switch_page/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/utilities.switch_page/requirements.txt +++ b/python/api-examples-source/utilities.switch_page/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/utilities.switch_page_query_params/requirements.txt b/python/api-examples-source/utilities.switch_page_query_params/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/utilities.switch_page_query_params/requirements.txt +++ b/python/api-examples-source/utilities.switch_page_query_params/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/api-examples-source/widget.menu_button.py b/python/api-examples-source/widget.menu_button.py new file mode 100644 index 000000000..81f6aa877 --- /dev/null +++ b/python/api-examples-source/widget.menu_button.py @@ -0,0 +1,9 @@ +import streamlit as st + +action = st.menu_button("Export", options=["CSV", "JSON", "PDF"]) +if action == "CSV": + st.write("Exporting as CSV...") +elif action == "JSON": + st.write("Exporting as JSON...") +elif action == "PDF": + st.write("Exporting as PDF...") diff --git a/python/api-examples-source/widget.page_link/requirements.txt b/python/api-examples-source/widget.page_link/requirements.txt index 337dd8121..764967e00 100644 --- a/python/api-examples-source/widget.page_link/requirements.txt +++ b/python/api-examples-source/widget.page_link/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 diff --git a/python/concept-source/requirements.txt b/python/concept-source/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/requirements.txt +++ b/python/concept-source/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-color-backgroundColor/requirements.txt b/python/concept-source/theming-color-backgroundColor/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-color-backgroundColor/requirements.txt +++ b/python/concept-source/theming-color-backgroundColor/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-color-baseRadius/requirements.txt b/python/concept-source/theming-color-baseRadius/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-color-baseRadius/requirements.txt +++ b/python/concept-source/theming-color-baseRadius/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-color-borderColor/requirements.txt b/python/concept-source/theming-color-borderColor/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-color-borderColor/requirements.txt +++ b/python/concept-source/theming-color-borderColor/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-color-primaryColor/requirements.txt b/python/concept-source/theming-color-primaryColor/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-color-primaryColor/requirements.txt +++ b/python/concept-source/theming-color-primaryColor/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-color-textColor/requirements.txt b/python/concept-source/theming-color-textColor/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-color-textColor/requirements.txt +++ b/python/concept-source/theming-color-textColor/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-overview-anthropic-light-inspried/requirements.txt b/python/concept-source/theming-overview-anthropic-light-inspried/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-overview-anthropic-light-inspried/requirements.txt +++ b/python/concept-source/theming-overview-anthropic-light-inspried/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/concept-source/theming-overview-spotify-inspired/requirements.txt b/python/concept-source/theming-overview-spotify-inspired/requirements.txt index 464451149..31c8b9196 100644 --- a/python/concept-source/theming-overview-spotify-inspired/requirements.txt +++ b/python/concept-source/theming-overview-spotify-inspired/requirements.txt @@ -1 +1 @@ -streamlit>=1.55.0 \ No newline at end of file +streamlit>=1.56.0 \ No newline at end of file diff --git a/python/tutorial-source/llm-18-lines-of-code/requirements.txt b/python/tutorial-source/llm-18-lines-of-code/requirements.txt index 05dcf6809..214acd4e8 100644 --- a/python/tutorial-source/llm-18-lines-of-code/requirements.txt +++ b/python/tutorial-source/llm-18-lines-of-code/requirements.txt @@ -1,2 +1,2 @@ -streamlit>=1.55.0 +streamlit>=1.56.0 langchain-openai