sai-lohith/streamlit_docs huggingface dataset:
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceremovePAGE ELEMENTSWrite and magicaddText elementsaddData elementsaddChart elementsaddInput widgetsaddMedia elementsaddLayouts and containersaddChat elementsaddStatus elementsaddThird-party componentsopen_in_newAPPLICATION LOGICNavigation and pagesaddExecution flowremovest.dialogst.formst.form_submit_buttonst.fragmentst.rerunst.stopCaching and stateaddConnections and secretsaddCustom componentsaddUtilitiesaddConfigurationaddTOOLSApp testingaddCommand lineaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/API reference/Execution flow/st.rerunst.rerunStreamlit VersionVersion 1.34.0Version 1.33.0Version 1.32.0Version 1.31.0Version 1.30.0Version 1.29.0Version 1.28.0Version 1.27.0Version 1.26.0Version 1.25.0Version 1.24.0Version 1.23.0Version 1.22.0Version 1.21.0Version 1.20.0Version 1.19.0Version 1.18.0Version 1.17.0Version 1.16.0Version 1.15.0Version 1.14.0Version 1.13.0Streamlit in SnowflakeRerun the script immediately.
When st.rerun() is called, the script is halted - no more statements will
be run, and the script will be queued to re-run from the top.
Function signature[source] st.rerun() 
Caveats for st.rerun
st.rerun is one of the tools to control the logic of your app. While it is great for prototyping, there can be adverse side effects:

Additional script runs may be inefficient and slower.
Excessive reruns may complicate your app's logic and be harder to follow.
If misused, infinite looping may crash your app.

In many cases where st.rerun works, callbacks may be a cleaner alternative. Containers may also be helpful.
A simple example in three variations
Using st.rerun to update an earlier header
import streamlit as st

if "value" not in st.session_state:
    st.session_state.value = "Title"

##### Option using st.rerun #####
st.header(st.session_state.value)

if st.button("Foo"):
    st.session_state.value = "Foo"
    st.rerun()

Using a callback to update an earlier header
##### Option using a callback #####
st.header(st.session_state.value)

def update_value():
    st.session_state.value = "Bar"

st.button("Bar", on_click=update_value)

Using containers to update an earlier header
##### Option using a container #####
container = st.container()

if st.button("Baz"):
    st.session_state.value = "Baz"

container.header(st.session_state.value)
Previous: st.fragmentNext: st.stopforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceremovePAGE ELEMENTSWrite and magicaddText elementsremoveHEADINGS & BODYst.titlest.headerst.subheaderst.markdownFORMATTED TEXTst.captionst.codest.dividerst.echost.latexst.textData elementsaddChart elementsaddInput widgetsaddMedia elementsaddLayouts and containersaddChat elementsaddStatus elementsaddThird-party componentsopen_in_newAPPLICATION LOGICNavigation and pagesaddExecution flowaddCaching and stateaddConnections and secretsaddCustom componentsaddUtilitiesaddConfigurationaddTOOLSApp testingaddCommand lineaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/API reference/Text elements/st.textst.textStreamlit VersionVersion 1.34.0Version 1.33.0Version 1.32.0Version 1.31.0Version 1.30.0Version 1.29.0Version 1.28.0Version 1.27.0Version 1.26.0Version 1.25.0Version 1.24.0Version 1.23.0Version 1.22.0Version 1.21.0Version 1.20.0Version 1.19.0Version 1.18.0Version 1.17.0Version 1.16.0Version 1.15.0Version 1.14.0Version 1.13.0Streamlit in SnowflakeWrite fixed-width and preformatted text.
Function signature[source] st.text(body, *, help=None) Parameters

body
(str)

 
The string to display.


help
(str)

 
An optional tooltip that gets displayed next to the text.
Example

import streamlit as st

st.text('This is some text.')



Previous: st.latexNext: Data elementsforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsremoveCOREArchitecture & executionaddMultipage appsaddApp designaddADDITIONALConnections and secretsaddCustom componentsremoveIntro to custom componentsCreate a ComponentPublish a ComponentLimitationsComponent galleryopen_in_newConfiguration and themingaddApp testingaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/Concepts/Custom componentsCustom Components
Components are third-party Python modules that extend what's possible with Streamlit.
How to use a Component
Components are super easy to use:


Start by finding the Component you'd like to use. Two great resources for this are:

The Component gallery
This thread,
by Fanilo A. from our forums.



Install the Component using your favorite Python package manager. This step and all following
steps are described in your component's instructions.
For example, to use the fantastic AgGrid
Component, you first install it with:
pip install streamlit-aggrid



In your Python code, import the Component as described in its instructions. For AgGrid, this step
is:
from st_aggrid import AgGrid



...now you're ready to use it! For AgGrid, that's:
AgGrid(my_dataframe)



Making your own Component
If you're interested in making your own component, check out the following resources:

Create a Component
Publish a Component
Components API
Blog post for when we launched Components!

Alternatively, if you prefer to learn using videos, our engineer Tim Conkling has put together some
amazing tutorials:
Video tutorial, part 1

Video tutorial, part 2
Previous: Connections and secretsNext: Intro to custom componentsforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Knowledge base/FAQ/How can I make st.pydeck_chart use custom Mapbox styles?How can I make st.pydeck_chart use custom Mapbox styles?
If you are supplying a Mapbox token, but the resulting pydeck_chart doesn't show your custom Mapbox styles, please check that you are adding the Mapbox token to the Streamlit config.toml configuration file. Streamlit DOES NOT read Mapbox tokens from inside of a PyDeck specification (i.e. from inside of the Streamlit app). Please see this forum thread for more information.Previous: How to insert elements out of order?Next: How to remove "· Streamlit" from the app title?forumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsremoveCOREArchitecture & executionremoveRunning your appStreamlit's architectureThe app chromeCachingSession StateFormsFragmentsWidget behaviorMultipage appsaddApp designaddADDITIONALConnections and secretsaddCustom componentsaddConfiguration and themingaddApp testingaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/Concepts/Architecture & executionWorking with Streamlit's execution model
Run your appUnderstand how to start your Streamlit app.Streamlit's architectureUnderstand Streamlit's client-server architecture and related considerations.The app chromeEvery Streamlit app has a few widgets in the top right to help you as you develop your app and help your users as they view your app. This is called the app chrome.CachingMake your app performant by caching results to avoid unecessary recomputation with each rerun.Session StateManage your app's statefulness with Session State.FormsUse forms to isolate user input and prevent unnecessary app reruns.Widget behaviorUnderstand how widgets work in detail.Previous: ConceptsNext: Running your appforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Knowledge base/Installing dependencies/ERROR No matching distribution found forERROR: No matching distribution found for
Problem
You receive the error ERROR: No matching distribution found for when you deploy an app on Streamlit Community Cloud.
Solution
This error occurs when you deploy an app on Streamlit Community Cloud and have one or more of the following issues with your Python dependencies in your requirements file:

The package is part of the Python Standard Library. E.g. You will see ERROR: No matching distribution found for base64 if you include base64 in your requirements file, as it is part of the Python Standard Library. The solution is to not include the package in your requirements file. Only include packages in your requirements file that are not distributed with a standard Python installation.
The package name in your requirements file is misspelled. Double-check the package name before including it in your requirements file.
The package does not support the operating system on which your Streamlit app is running. E.g. You see ERROR: No matching distribution found for pywin32 while deploying to Streamlit Community Cloud. The pywin32 module provides access to many of the Windows APIs from Python. Apps deployed to Streamlit Community Cloud are executed in a Linux environment. As such, pywin32 fails to install on non-Windows systems, including on Streamlit Community Cloud. The solution is to either exclude pywin32 from your requirements file, or deploy your app on a cloud service offering Windows machines.

Related forum posts:

https://discuss.streamlit.io/t/error-no-matching-distribution-found-for-base64/15758
https://discuss.streamlit.io/t/error-could-not-find-a-version-that-satisfies-the-requirement-pywin32-301-from-versions-none/15343/2
Previous: ModuleNotFoundError No module namedNext: Deployment issuesforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceaddTutorialsremoveExecution flowremoveFRAGMENTSRerun your app from a fragmentCreate a multiple-container fragmentStart and stop a streaming fragmentConnect to data sourcesaddMultipage appsaddWork with LLMsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/Tutorials/Execution flowUse core features to work with Streamlit's execution model
Fragments
Trigger a full-script rerun from inside a fragmentCall st.rerun from inside a fragment to trigger a full-script rerun when a condition is met.Create a fragment across multiple containersUse a fragment to write to multiple containers across your app.Start and stop a streaming fragmentUse a fragment to live-stream data. Use a button to start and stop the live-streaming.Previous: TutorialsNext: Rerun your app from a fragmentforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsremoveCOREArchitecture & executionaddMultipage appsaddApp designaddADDITIONALConnections and secretsaddCustom componentsaddConfiguration and themingremoveConfiguration optionsHTTPS supportServing static filesCustomize your themeApp testingaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/Concepts/Configuration and theming/Serving static filesStatic file serving
Streamlit apps can host and serve small, static media files to support media embedding use cases that
won't work with the normal media elements.
To enable this feature, set enableStaticServing = true under [server] in your config file,
or environment variable STREAMLIT_SERVER_ENABLE_STATIC_SERVING=true.
Media stored in the folder ./static/ relative to the running app file is served at path
app/static/[filename], such as http://localhost:8501/app/static/cat.png.
Details on usage

Files with the following extensions will be served normally: ".jpg", ".jpeg", ".png", ".gif". Any other
file will be sent with header Content-Type:text/plain which will cause browsers to render in plain text.
This is included for security - other file types that need to render should be hosted outside the app.
Streamlit also sets X-Content-Type-Options:nosniff for all files rendered from the static directory.
For apps running on Streamlit Community Cloud:

Files available in the Github repo will always be served. Any files generated while the app is running,
such as based on user interaction (file upload, etc), are not guaranteed to persist across user sessions.
Apps which store and serve many files, or large files, may run into resource limits and be shut down.



Example usage

Put an image cat.png in the folder ./static/
Add enableStaticServing = true under [server] in your .streamlit/config.toml
Any media in the ./static/ folder is served at the relative URL like app/static/cat.png

# .streamlit/config.toml

[server]
enableStaticServing = true

# app.py
import streamlit as st

with st.echo():
    st.title("CAT")

    st.markdown("[![Click me](app/static/cat.png)](https://streamlit.io)")


Additional resources:

https://docs.streamlit.io/develop/concepts/configuration
https://static-file-serving.streamlit.app/

Built with Streamlit 🎈Fullscreen open_in_newPrevious: HTTPS supportNext: Customize your themeforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceremovePAGE ELEMENTSWrite and magicaddText elementsaddData elementsaddChart elementsremoveSIMPLEst.area_chartst.bar_chartst.line_chartst.mapst.scatter_chartADVANCEDst.altair_chartst.bokeh_chartst.graphviz_chartst.plotly_chartst.pydeck_chartst.pyplotst.vega_lite_chartInput widgetsaddMedia elementsaddLayouts and containersaddChat elementsaddStatus elementsaddThird-party componentsopen_in_newAPPLICATION LOGICNavigation and pagesaddExecution flowaddCaching and stateaddConnections and secretsaddCustom componentsaddUtilitiesaddConfigurationaddTOOLSApp testingaddCommand lineaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/API reference/Chart elements/st.pyplotst.pyplotStreamlit VersionVersion 1.34.0Version 1.33.0Version 1.32.0Version 1.31.0Version 1.30.0Version 1.29.0Version 1.28.0Version 1.27.0Version 1.26.0Version 1.25.0Version 1.24.0Version 1.23.0Version 1.22.0Version 1.21.0Version 1.20.0Version 1.19.0Version 1.18.0Version 1.17.0Version 1.16.0Version 1.15.0Version 1.14.0Version 1.13.0Streamlit in SnowflakeDisplay a matplotlib.pyplot figure.
Function signature[source] st.pyplot(fig=None, clear_figure=None, use_container_width=True, **kwargs) Parameters

fig
(Matplotlib Figure)

 
The figure to plot. When this argument isn't specified, this
function will render the global figure (but this is deprecated,
as described below)


clear_figure
(bool)

 
If True, the figure will be cleared after being rendered.
If False, the figure will not be cleared after being rendered.
If left unspecified, we pick a default based on the value of fig.

If fig is set, defaults to False.
If fig is not set, defaults to True. This simulates Jupyter's
approach to matplotlib rendering.



use_container_width
(bool)

 
If True, set the chart width to the column width. Defaults to True.


**kwargs
(any)

 
Arguments to pass to Matplotlib's savefig function.
Example

import streamlit as st
import matplotlib.pyplot as plt
import numpy as np

arr = np.random.normal(1, 1, size=100)
fig, ax = plt.subplots()
ax.hist(arr, bins=20)

st.pyplot(fig)

Built with Streamlit 🎈Fullscreen open_in_new

Notes

Note
Deprecation warning. After December 1st, 2020, we will remove the ability
to specify no arguments in st.pyplot(), as that requires the use of
Matplotlib's global figure object, which is not thread-safe. So
please always pass a figure object as shown in the example section
above.

Matplotlib supports several types of "backends". If you're getting an
error using Matplotlib with Streamlit, try setting your backend to "TkAgg":

echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc

For more information, see https://matplotlib.org/faq/usage_faq.html.

Previous: st.pydeck_chartNext: st.vega_lite_chartforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesStreamlit documentationStreamlit is an open-source Python framework for data scientists and AI/ML engineers to deliver dynamic data apps with only a few lines of code. Build and deploy powerful data apps in minutes. Let's get started!install_desktopSetup and installationGet set up to start working with Streamlit.dvrAPI referenceLearn about our APIs, with actionable explanations of specific functions and features.grid_viewApp galleryTry out awesome apps created by our users, and curated from our forums or Twitter.How to use our docsrocket_launchGet started with Streamlit! Set up your development environment and learn the fundamental concepts, and start coding!descriptionDevelop your Streamlit app! Our API reference explains each Streamlit function with examples. Dive deep into all of our features with conceptual guides. Try out our step-by-step tutorials.cloudDeploy your Streamlit app! Streamlit Community Cloud our free platform for deploying and sharing Streamlit apps. Streamlit in Snowflake is an enterprise-class solution where you can house your data and apps in one, unified, global system. Explore all your options!schoolKnowledge base is a self-serve library of tips, tricks, and articles that answer your questions about creating and deploying Streamlit apps.What's newcrop_7_5Modal dialogsIntroducing st.experimental_dialog to create modal dialogs that can rerun independently from the rest of your app.infoGoogle Material Symbolsst.toast, st.chat_message, and alert messages now support Material Symbols for their icons.highlightMarkdown support for text highlightingYou can set the background color for you text in markdown.videocamMedia autoplayYou can enable autoplay for st.audio andst.video. You can also mute videos.cachedClear specific cached valuesWhen clearing cached values for a function, you can now pass function arguments to clear a specific cached value.question_markst.query_params.from_dict()You can now set all query parameters with a single command.Latest blog postsView all updatesJoin the communityStreamlit is more than just a way to make data apps, it's also a community of creators that share their apps and ideas and help each other make their work better. Please come join us on the community forum. We love to hear your questions, ideas, and help you work through your bugs — stop by today!View forumOther MediaGitHubView the Streamlit source code and issue tracker.YouTubeWatch screencasts made by the Streamlit team and the community.TwitterFollow @streamlit on Twitter to keep up with the latest news.LinkedInFollow @streamlit on the world's largest professional network.NewsletterSign up for communications from Streamlit.Next: Get startedHomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy
DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudremoveGet startedaddDeploy your appaddManage your appremoveApp analyticsApp settingsDelete your appEdit your appFavorite your appReboot your appShare your appaddManage your accountaddTroubleshootingStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Deploy/Streamlit Community Cloud/Manage your app/Delete your appDelete your app
If you need to delete your app, it's simple and easy. There are several cases where you may need to delete your app:

You have finished playing around with an example app.
You want to deploy from a private repository but already have a private app.
You want to change the Python version for your app or otherwise redeploy your app.

If you delete your app and intend to immediately redploy it, your custom subdomain should be immediately available for reuse. Read more about data deletion in Streamlit trust and security.
You can delete your app:

From your workspace.
From your Cloud logs.

Delete your app from your workspace


From your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click "Delete".



A confirmation will display. Enter the required confirmation string and click "Delete".



Delete your app from your Cloud logs


From your app at <your-custom-subdomain>.streamlit.app, click "Manage app" in the lower-right corner.



Click the overflow menu icon (more_vert) and click "Delete app".



A confirmation will display. Enter the required confirmation string and click "Delete".


Previous: App settingsNext: Edit your appforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy