Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 918 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 918 Bytes

Streamlit javascript execution

GitHub PyPI

Installation

pip install streamlit-javascript

Getting started

from streamlit_javascript import st_javascript

st.subheader("Javascript API call")

return_value = st_javascript("""await fetch("https://reqres.in/api/products/3").then(function(response) {
    return response.json();
}) """)

st.markdown(f"Return value was: {return_value}")
print(f"Return value was: {return_value}")

Demo

example image