Introduction to Streamlit: Python Web Apps Without HTML
Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.
One of the biggest challenges in data science and machine learning is sharing your work with people who don’t use Python. Jupyter notebooks require a running kernel; command-line scripts produce no visual output; and building a proper web frontend requires HTML, CSS, and JavaScript skills most data scientists don’t have. Streamlit solves this problem by letting you turn a plain Python script into a fully interactive web application — with no frontend code whatsoever. You write Python, run one command, and anyone with a browser can use your app.
What Is Streamlit?
Streamlit is an open-source Python library designed for building data dashboards, AI demos, and interactive internal tools. It is especially popular for:
AI chat interfaces — connect to a language model and wrap it in a UI
Data dashboards — upload a CSV, visualize it, and filter results interactively
ML model demos — let non-technical users adjust inputs and see predictions
Internal business tools — replace clunky spreadsheet workflows with polished apps
How Streamlit Works
Streamlit follows a simple client-server architecture:
Your Python script runs as a server process.
The browser displays the rendered interface as a client.
When the user interacts with any widget (button, slider, text field), the browser sends the event to the server.
Streamlit reruns your entire script from top to bottom to refresh the UI with the updated values.
This rerun model is the key mental model to internalize. Every interaction triggers a full script re-execution. This keeps the UI in sync with your Python logic automatically — but it also means you need to understand caching (covered in the Data Handling chapter) to avoid re-running expensive operations on every rerun.
Every time you type a character in the text field, Streamlit reruns the script, evaluates the if block, and updates the greeting instantly.
Creating and Running an App
Recommended Project Structure
A simple Streamlit project typically looks like this:
my_project/├── app.py ← main app logic├── data/ ← CSV or JSON data files├── images/ ← local images used in the app├── pages/ ← additional pages for multipage apps└── requirements.txt
For multipage apps, place additional Python files inside a pages/ directory. Streamlit automatically detects them and adds navigation links in the sidebar — no routing code required.
What’s in This Module
The Streamlit module is organized into five sections that build on each other:
Section
What You’ll Learn
Displaying Content
Text, tables, images, code blocks, status messages
Widgets
Buttons, text inputs, sliders, file uploaders, date pickers
Full capstone project — a Student Performance Dashboard
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"Python for AI \u0026 FastAPI","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"favicon":"https://mintcdn.com/fastapi2day/o2Jso_KhqkR4_ilm/favicon.svg?fit=max\u0026auto=format\u0026n=o2Jso_KhqkR4_ilm\u0026q=85\u0026s=d4ea6ac51fe137dae217309616455228","navbar":{"primary":{"type":"button","label":"Start Learning","href":"https://sgrinfo.tech"}},"footer":{},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fastapi2day","hasAudioNarration":false,"actualSubdomain":"fastapi2day","customDomains":["fastapi2day.codewithsiva.dev"],"gitSource":{"type":"github","owner":"mintlify-community","repo":"docs-sgrinfotech-31e4544d","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6aea217d8509c0a36927aa68:success","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Data \u0026 APIs","count":31},{"language":"default","tag":"Python","count":24},{"language":"default","tag":"Getting Started","count":21},{"language":"default","tag":"Projects \u0026 Tools","count":19},{"language":"default","tag":"FastAPI","count":15},{"language":"default","tag":"Advanced","count":12},{"language":"default","tag":"Basics","count":7},{"language":"default","tag":"Environments \u0026 Packages","count":7},{"language":"default","tag":"VS Code","count":6},{"language":"default","tag":"Python Setup","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"streamlit/intro","slug":"/streamlit/intro","pageMetadata":{"title":"Introduction to Streamlit: Python Web Apps Without HTML","sidebarTitle":"Introduction","description":"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.","href":"/streamlit/intro"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Steps,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`One of the biggest challenges in data science and machine learning is sharing your work with people who don’t use Python. Jupyter notebooks require a running kernel; command-line scripts produce no visual output; and building a proper web frontend requires HTML, CSS, and JavaScript skills most data scientists don’t have. `,_jsx(_components.strong,{children:`Streamlit`}),` solves this problem by letting you turn a plain Python script into a fully interactive web application — with no frontend code whatsoever. You write Python, run one command, and anyone with a browser can use your app.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-is-streamlit`,children:`What Is Streamlit?`}),`\n`,_jsx(_components.p,{children:`Streamlit is an open-source Python library designed for building data dashboards, AI demos, and interactive internal tools. It is especially popular for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`AI chat interfaces`}),` — connect to a language model and wrap it in a UI`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Data dashboards`}),` — upload a CSV, visualize it, and filter results interactively`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`ML model demos`}),` — let non-technical users adjust inputs and see predictions`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Internal business tools`}),` — replace clunky spreadsheet workflows with polished apps`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-streamlit-works`,children:`How Streamlit Works`}),`\n`,_jsxs(_components.p,{children:[`Streamlit follows a simple `,_jsx(_components.strong,{children:`client-server architecture`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Your Python script runs as a server process.`}),`\n`,_jsx(_components.li,{children:`The browser displays the rendered interface as a client.`}),`\n`,_jsx(_components.li,{children:`When the user interacts with any widget (button, slider, text field), the browser sends the event to the server.`}),`\n`,_jsxs(_components.li,{children:[`Streamlit `,_jsx(_components.strong,{children:`reruns your entire script from top to bottom`}),` to refresh the UI with the updated values.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`This `,_jsx(_components.strong,{children:`rerun model`}),` is the key mental model to internalize. Every interaction triggers a full script re-execution. This keeps the UI in sync with your Python logic automatically — but it also means you need to understand caching (covered in the Data Handling chapter) to avoid re-running expensive operations on every rerun.`]}),`\n`,_jsx(Heading,{level:`3`,id:`a-simple-example`,children:`A Simple Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` streamlit `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` st`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`st.title(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello Streamlit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`name `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` st.text_input(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Your name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` name:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` st.write(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Every time you type a character in the text field, Streamlit reruns the script, evaluates the `,_jsx(_components.code,{children:`if`}),` block, and updates the greeting instantly.`]}),`\n`,_jsx(Heading,{level:`2`,id:`creating-and-running-an-app`,children:`Creating and Running an App`}),`\n`,_jsxs(Steps,{children:[_jsx(Heading,{level:`3`,id:`install-streamlit`,children:`Install Streamlit`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pip`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` streamlit`})]}),`\n`]})})}),_jsx(Heading,{level:`3`,id:`create-your-app-file`,children:`Create Your App File`}),_jsxs(_components.p,{children:[`Create a file called `,_jsx(_components.code,{children:`app.py`}),` with your Streamlit code.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` streamlit `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` st`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`st.title(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My First App\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`st.write(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Welcome to Streamlit!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(Heading,{level:`3`,id:`run-the-app`,children:`Run the App`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`streamlit`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app.py`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Streamlit starts a local development server, typically at `,_jsx(_components.code,{children:`http://localhost:8501`}),`, and opens your app in the default browser automatically.`]}),_jsx(Heading,{level:`3`,id:`edit-and-reload`,children:`Edit and Reload`}),_jsxs(_components.p,{children:[`Edit `,_jsx(_components.code,{children:`app.py`}),` and save. Streamlit detects the change and shows a `,_jsx(_components.strong,{children:`Rerun`}),` button in the top-right corner of the browser. Click it (or enable auto-rerun) to see your changes immediately.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-project-structure`,children:`Recommended Project Structure`}),`\n`,_jsx(_components.p,{children:`A simple Streamlit project typically looks like this:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`my_project/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── app.py ← main app logic`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── data/ ← CSV or JSON data files`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── images/ ← local images used in the app`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── pages/ ← additional pages for multipage apps`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└── requirements.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`For multipage apps, place additional Python files inside a `,_jsx(_components.code,{children:`pages/`}),` directory. Streamlit automatically detects them and adds navigation links in the sidebar — no routing code required.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-in-this-module`,children:`What’s in This Module`}),`\n`,_jsx(_components.p,{children:`The Streamlit module is organized into five sections that build on each other:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Section`}),_jsx(_components.th,{children:`What You’ll Learn`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Displaying Content`})}),_jsx(_components.td,{children:`Text, tables, images, code blocks, status messages`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Widgets`})}),_jsx(_components.td,{children:`Buttons, text inputs, sliders, file uploaders, date pickers`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Data Handling`})}),_jsx(_components.td,{children:`Loading CSVs, filtering DataFrames, Matplotlib charts`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Building Apps`})}),_jsx(_components.td,{children:`Full capstone project — a Student Performance Dashboard`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Introduction to Streamlit: Python Web Apps Without HTML","sidebarTitle":"Introduction","description":"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.","href":"/streamlit/intro"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What Is Streamlit?","slug":"what-is-streamlit","depth":2,"children":[]},{"title":"How Streamlit Works","slug":"how-streamlit-works","depth":2,"children":[{"title":"A Simple Example","slug":"a-simple-example","depth":3,"children":[]}]},{"title":"Creating and Running an App","slug":"creating-and-running-an-app","depth":2,"children":[{"title":"Install Streamlit","slug":"install-streamlit","depth":3,"children":[]},{"title":"Create Your App File","slug":"create-your-app-file","depth":3,"children":[]},{"title":"Run the App","slug":"run-the-app","depth":3,"children":[]},{"title":"Edit and Reload","slug":"edit-and-reload","depth":3,"children":[]}]},{"title":"Recommended Project Structure","slug":"recommended-project-structure","depth":2,"children":[]},{"title":"What’s in This Module","slug":"what’s-in-this-module","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fastapi2day","siteName":"Python for AI \u0026 FastAPI","title":"Introduction to Streamlit: Python Web Apps Without HTML - Python for AI \u0026 FastAPI","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-03T17:23:05.091Z","originalFileLocation":"streamlit/intro.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Python for AI \u0026amp; FastAPI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/svg+xml\" sizes=\"180x180\" href=\"https://mintcdn.com/fastapi2day/o2Jso_KhqkR4_ilm/favicon.svg?fit=max\u0026amp;auto=format\u0026amp;n=o2Jso_KhqkR4_ilm\u0026amp;q=85\u0026amp;s=d4ea6ac51fe137dae217309616455228\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"32x32\" href=\"https://mintcdn.com/fastapi2day/o2Jso_KhqkR4_ilm/favicon.svg?fit=max\u0026amp;auto=format\u0026amp;n=o2Jso_KhqkR4_ilm\u0026amp;q=85\u0026amp;s=d4ea6ac51fe137dae217309616455228\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"16x16\" href=\"https://mintcdn.com/fastapi2day/o2Jso_KhqkR4_ilm/favicon.svg?fit=max\u0026amp;auto=format\u0026amp;n=o2Jso_KhqkR4_ilm\u0026amp;q=85\u0026amp;s=d4ea6ac51fe137dae217309616455228\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/svg+xml\" href=\"https://mintcdn.com/fastapi2day/o2Jso_KhqkR4_ilm/favicon.svg?fit=max\u0026amp;auto=format\u0026amp;n=o2Jso_KhqkR4_ilm\u0026amp;q=85\u0026amp;s=d4ea6ac51fe137dae217309616455228\">\u003cmeta data-mint-head property=\"og:title\" content=\"Introduction to Streamlit: Python Web Apps Without HTML - Python for AI \u0026amp; FastAPI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Python for AI \u0026amp; FastAPI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://fastapi2day.codewithsiva.dev/streamlit/intro\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fastapi2day.mintlify.site/_mintlify/api/og/v2?division=Frontend\u0026amp;title=Introduction+to+Streamlit%3A+Python+Web+Apps+Without+HTML\u0026amp;description=Learn+what+Streamlit+is%2C+how+its+rerun+execution+model+works%2C+and+how+to+create+and+run+your+first+interactive+Python+web+application.\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=cea95c4972267f0e82f5b435edcbba0586edf9d2a43dd00ff4d282691fb967ef\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Introduction to Streamlit: Python Web Apps Without HTML - Python for AI \u0026amp; FastAPI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fastapi2day.mintlify.site/_mintlify/api/og/v2?division=Frontend\u0026amp;title=Introduction+to+Streamlit%3A+Python+Web+Apps+Without+HTML\u0026amp;description=Learn+what+Streamlit+is%2C+how+its+rerun+execution+model+works%2C+and+how+to+create+and+run+your+first+interactive+Python+web+application.\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=cea95c4972267f0e82f5b435edcbba0586edf9d2a43dd00ff4d282691fb967ef\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/fastapi2day/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Python for AI \u0026amp; FastAPI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://fastapi2day.codewithsiva.dev/streamlit/intro\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/streamlit/intro.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://fastapi2day.codewithsiva.dev/#organization\",\"name\":\"Python for AI \u0026 FastAPI\",\"url\":\"https://fastapi2day.codewithsiva.dev\"},{\"@type\":\"WebSite\",\"@id\":\"https://fastapi2day.codewithsiva.dev#website\",\"name\":\"Python for AI \u0026 FastAPI\",\"url\":\"https://fastapi2day.codewithsiva.dev\",\"publisher\":{\"@id\":\"https://fastapi2day.codewithsiva.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro#webpage\",\"url\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro\",\"name\":\"Introduction to Streamlit: Python Web Apps Without HTML\",\"description\":\"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\",\"dateModified\":\"2026-08-03T17:23:05.091Z\",\"isPartOf\":{\"@id\":\"https://fastapi2day.codewithsiva.dev#website\"},\"breadcrumb\":{\"@id\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Python for AI \u0026 FastAPI\",\"item\":\"https://fastapi2day.codewithsiva.dev\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to Streamlit: Python Web Apps Without HTML\",\"item\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro#article\",\"headline\":\"Introduction to Streamlit: Python Web Apps Without HTML\",\"name\":\"Introduction to Streamlit: Python Web Apps Without HTML\",\"description\":\"Learn what Streamlit is, how its rerun execution model works, and how to create and run your first interactive Python web application.\",\"url\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro\",\"mainEntityOfPage\":{\"@id\":\"https://fastapi2day.codewithsiva.dev/streamlit/intro#webpage\"},\"dateModified\":\"2026-08-03T17:23:05.091Z\",\"publisher\":{\"@id\":\"https://fastapi2day.codewithsiva.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://fastapi2day.codewithsiva.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Python for AI \u0026 FastAPI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Python for AI \u0026 FastAPI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/streamlit/intro.md","siteName":"Python for AI \u0026 FastAPI","nav":{"global":null,"tabs":[{"tab":"Introduction","pages":[{"title":"Introduction","href":""}]},{"tab":"Getting Started","pages":[{"title":"Getting Started","href":"/getting-started"}]},{"tab":"Python","pages":[{"title":"Python","href":"/basic-python/python-basics"}]},{"tab":"Projects \u0026 Tools","pages":[{"title":"Projects \u0026 Tools","href":"/tools"}]},{"tab":"Data \u0026 APIs","groups":[{"group":"SQL \u0026 Databases","pages":[{"title":"Introduction to Databases, DBMS \u0026 SQL Fundamentals","sidebarTitle":"Introduction","href":"/sql/intro"},{"title":"SQLite, DDL \u0026 DML: Define and Manipulate Your Data","sidebarTitle":"DDL \u0026 DML","href":"/sql/sqlite-ddl-dml"},{"title":"Setting Up Your SQLite Practice Database in VS Code","sidebarTitle":"DB Setup","href":"/sql/sqlite-dbsetup"},{"title":"DQL: Querying and Analyzing Your Data with SQL SELECT","sidebarTitle":"Querying","href":"/sql/dql"},{"title":"SQL Joins: Combining Data Across Relational Tables","sidebarTitle":"Joins","href":"/sql/joins"},{"title":"Advanced SQL: Normalization, ACID, and Window Functions","sidebarTitle":"Advanced SQL","href":"/sql/adv-sql"}]},{"group":"Data Analysis","pages":[{"title":"NumPy: Numerical Computing Foundations for Data Science","sidebarTitle":"NumPy","href":"/data-analysis/numpy"},{"title":"Pandas: Python Library for Data Manipulation and Analysis","sidebarTitle":"Pandas","href":"/data-analysis/pandas"},{"title":"Matplotlib: Building Charts and Visualizations in Python","sidebarTitle":"Matplotlib","href":"/data-analysis/matplotlib"},{"title":"Seaborn: Statistical Data Visualization for Python","sidebarTitle":"Seaborn","href":"/data-analysis/seaborn"},{"title":"Data Visualization Guide: Uni, Bi \u0026 Multivariate Analysis","sidebarTitle":"Viz Guide","href":"/data-analysis/visualization-guide"}]},{"group":"FastAPI","pages":[{"title":"FastAPI Foundations: Build Production-Ready Python APIs","sidebarTitle":"Overview","href":"/fastapi-foundations/index"},{"title":"How the Web Works: HTTP Requests, Responses \u0026 Status Codes","sidebarTitle":"How Web Works","href":"/fastapi-foundations/how-web-works"},{"title":"Introduction to FastAPI: Install and Run Your First API","sidebarTitle":"Intro to FastAPI","href":"/fastapi-foundations/intro-to-fastapi"},{"title":"FastAPI Fundamentals: Routing, Params \u0026 Validation","sidebarTitle":"Fundamentals","href":"/fastapi-foundations/fundamentals"},{"title":"Request Handling in FastAPI: Params, Bodies \u0026 Headers","sidebarTitle":"Requests","href":"/fastapi-foundations/request-handling"},{"title":"Response Handling in FastAPI: Models, Codes \u0026 Errors","sidebarTitle":"Responses","href":"/fastapi-foundations/response-handling"},{"title":"FastAPI Data Validation and Pydantic Models in Python","sidebarTitle":"Validation","href":"/fastapi-foundations/data-validation-models"},{"title":"In-Memory CRUD Operations with FastAPI and Pydantic","sidebarTitle":"CRUD","href":"/fastapi-foundations/local-crud"},{"title":"API Documentation: Swagger UI and ReDoc in FastAPI","sidebarTitle":"API Docs","href":"/fastapi-foundations/api-documentation"},{"title":"Modular Routing with FastAPI APIRouter and Prefixes","sidebarTitle":"APIRouter","href":"/fastapi-foundations/apirouter"},{"title":"FastAPI Exception Handling: HTTP \u0026 Validation Errors","sidebarTitle":"Exceptions","href":"/fastapi-foundations/exception-handling"},{"title":"FastAPI Dependency Injection with Depends() Explained","sidebarTitle":"Dependencies","href":"/fastapi-foundations/dependency-injection"},{"title":"Modularising FastAPI: Controller, Service, Repository","sidebarTitle":"Modularisation","href":"/fastapi-foundations/modularisation"},{"title":"SQL \u0026 ORM Integration with FastAPI and SQLModel Guide","sidebarTitle":"SQL \u0026 ORM","href":"/fastapi-foundations/sql-orm"},{"title":"JWT Authentication and Role-Based Access in FastAPI","sidebarTitle":"JWT Auth","description":"Implement JWT token-based authentication in FastAPI — register users, hash passwords, issue access tokens, protect routes with Depends, and enforce roles.","href":"/fastapi-foundations/jwt-auth"}]},{"group":"Frontend","pages":[{"title":"Introduction to Streamlit: Python Web Apps Without HTML","sidebarTitle":"Introduction","href":"/streamlit/intro"},{"title":"Displaying Text, Tables, and Media in Streamlit Apps","sidebarTitle":"Displaying Content","description":"Render text, markdown, headers, tables, DataFrames, images, code blocks, JSON, and status messages inside your Streamlit application.","href":"/streamlit/displaying-content"},{"title":"Streamlit Widgets: Collecting and Handling User Input","sidebarTitle":"Widgets","href":"/streamlit/widgets"},{"title":"Working with Data, Charts, and Caching in Streamlit","sidebarTitle":"Data Handling","href":"/streamlit/data-handling"},{"title":"Building a Complete Streamlit Student Dashboard App","sidebarTitle":"Building Apps","href":"/streamlit/streamlit-app"}]}]}]},"basePath":"","title":"Introduction to Streamlit: Python Web Apps Without HTML - Python for AI \u0026 FastAPI","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}