Skip to main content

component to run javascript code in streamlit application

Project description

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

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-javascript-0.1.4.tar.gz (512.4 kB view hashes)

Uploaded Source

Built Distribution

streamlit_javascript-0.1.4-py3-none-any.whl (518.4 kB view hashes)

Uploaded Python 3

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