Streamlit is an open-source Python framework that transforms data scripts into interactive web applications with minimal code. Built specifically for data scientists and ML engineers, Streamlit eliminates the need for frontend development expertise β write simple Python scripts and instantly see results as responsive UIs. Its pure-Python declarative model runs scripts top-to-bottom on every interaction, automatically managing UI updates and enabling rapid prototyping. The framework's true power lies in its caching primitives, session state management, and fragment-based partial reruns, which together enable building production-grade data apps that handle complex workflows, real-time updates, and stateful interactions efficiently.
What This Cheat Sheet Covers
This topic spans 24 focused tables and 141 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Display Functions
| Function | Example | Description |
|---|---|---|
st.write("Hello **world**!")st.write(df)st.write(fig) | Streamlit's "magic" function that intelligently renders almost any Python object β dataframes, charts, markdown, dicts, or plain text β choosing the appropriate display format automatically. | |
st.markdown("# Header")st.markdown("Text with **bold**") | Renders a string as formatted Markdown with full support for headers, emphasis, lists, links, and inline HTML; set unsafe_allow_html=True to enable raw HTML rendering. | |
st.title("My App Title") | Displays text in large title formatting at the top of your app β the visual headline users see first. | |
st.header("Section Header") | Displays text in header formatting β larger than regular text but smaller than title β used to organize app sections. | |
st.subheader("Subsection") | Displays text in subheader formatting β useful for creating visual hierarchy within sections. | |
st.caption("Small explanatory text") | Displays text in small font β ideal for footnotes, disclaimers, or supplementary information. |