Skip to content

Commit 6187cae

Browse files
Update embedded apps for release 1.33.0 (#1027)
* Update streamlit version in embedded apps * Add fragment and html examples
1 parent 0dac00c commit 6187cae

File tree

15 files changed

+62
-12
lines changed

15 files changed

+62
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
22
webvtt-py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import streamlit as st
2+
3+
if "clicks" not in st.session_state:
4+
st.session_state.clicks = 0
5+
6+
7+
@st.experimental_fragment
8+
def count_to_five():
9+
if st.button("Plus one!"):
10+
st.session_state.clicks += 1
11+
if st.session_state.clicks % 5 == 0:
12+
st.rerun()
13+
return
14+
15+
16+
count_to_five()
17+
st.header(f"Multiples of five clicks: {st.session_state.clicks // 5}")
18+
19+
if st.button("Check click count"):
20+
st.toast(f"## Total clicks: {st.session_state.clicks}")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import streamlit as st
2+
3+
if "script_runs" not in st.session_state:
4+
st.session_state.script_runs = 0
5+
st.session_state.fragment_runs = 0
6+
7+
8+
@st.experimental_fragment
9+
def fragment():
10+
st.session_state.fragment_runs += 1
11+
st.button("Rerun fragment")
12+
st.write(f"Fragment says it ran {st.session_state.fragment_runs} times.")
13+
14+
15+
st.session_state.script_runs += 1
16+
fragment()
17+
st.button("Rerun full script")
18+
st.write(f"Full script says it ran {st.session_state.script_runs} times.")
19+
st.write(f"Full script sees that fragment ran {st.session_state.fragment_runs} times.")
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0

python/api-examples-source/hello/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ numpy==1.23.5
88
scipy
99
altair==4.2.0
1010
pydeck==0.8.0
11-
streamlit==1.32.2
11+
streamlit==1.33.0

python/api-examples-source/mpa-hello/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ scipy
44
altair==4.2.0
55
pydeck==0.8.0
66
opencv-python-headless==4.6.0.66
7-
streamlit==1.32.2
7+
streamlit==1.33.0

python/api-examples-source/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ altair==4.2.0
1010
pydeck==0.8.0
1111
Faker==19.1.0
1212
openai==1.3.0
13-
streamlit==1.32.2
13+
streamlit==1.33.0

python/api-examples-source/st-experimental-connection/1.22/st-experimental-connection/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
22
toml
33
sqlalchemy==1.4
44
duckdb
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
22
vega_datasets
33
altair==4.2.0
44
plotly==5.13.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import streamlit as st
2+
3+
code = """
4+
<style>
5+
p {
6+
color: red;
7+
}
8+
</style>
9+
"""
10+
st.html(code)
11+
st.markdown("Lorem ipsum")
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
streamlit==1.32.2
1+
streamlit==1.33.0
22
openai
33
langchain

0 commit comments

Comments
 (0)