diff --git a/.gitignore b/.gitignore index 2d7f31fab..dc821b9b4 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,4 @@ out/ public/pdf/pages/ .idea/ secrets.toml +content_catalog.json diff --git a/netlify.toml b/netlify.toml index 287030946..515983015 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,14 +1,18 @@ +[build] +command = "make export" +publish = "out" + [[plugins]] - # Setting the plugin manually, so we can pick the version (see package.json). - package = "@netlify/plugin-nextjs" +# Setting the plugin manually, so we can pick the version (see package.json). +package = "@netlify/plugin-nextjs" # IMPORTANT: Keep this in sync with next.config.js [[headers]] - for = "/*" - [headers.values] - Strict-Transport-Security = "max-age=31536000; includeSubDomains" - X-Content-Type-Options = "nosniff" - Content-Security-Policy = """ +for = "/*" +[headers.values] +Strict-Transport-Security = "max-age=31536000; includeSubDomains" +X-Content-Type-Options = "nosniff" +Content-Security-Policy = """ upgrade-insecure-requests; \ frame-ancestors 'self' ; \ frame-src https: ; \ diff --git a/public/content_catalog.json b/public/content_catalog.json deleted file mode 100644 index 5591ca5d5..000000000 --- a/public/content_catalog.json +++ /dev/null @@ -1,1402 +0,0 @@ -[ - { - "url": "https://docs.streamlit.io/develop", - "content": "# Develop\n\nGet all the information you need to build beautiful, performant web apps with Streamlit!\n\n\n Learn how Streamlit works with in-depth guides to our execution model and features.\n Learn about our API with function definitions and examples.\n Follow step-by-step instructions to build example apps and useful snippets.\n Check out our quick references for easy access to convenient information like our changelog, cheat sheet, pre-release features, and roadmap.\n" - }, - { - "url": "https://docs.streamlit.io/knowledge-base", - "content": "# Knowledge base\n\nThe knowledge base is a self-serve library of tips, step-by-step tutorials, and articles that answer your questions about creating and deploying Streamlit apps.\n\n\n Here are some frequently asked questions about using Streamlit.\n If you run into problems installing dependencies for your Streamlit apps, we've got you covered.\n Have questions about deploying Streamlit apps to the cloud? This section covers deployment-related issues.\n" - }, - { - "url": "https://docs.streamlit.io/deploy", - "content": "# Deploy\n\nGet all the information you need to deploy your app and share it with your users.\n\n\n Understand the basics of app deployment.\n Deploy your app on our free platform and join a community of developers who share their apps around the world. This is a great place for your non-commerical, personal, and educational apps.\n Deploy your app in Snowflake for a secure, enterprise-grade environment. This is a great place for your business apps.\n Learn how to deploy your app on a variety of platforms with our convenient collection of tutorials.\n" - }, - { - "url": "https://docs.streamlit.io/get-started", - "content": "# Get started with Streamlit\n\nThis Get Started guide explains how Streamlit works, how to install Streamlit on your preferred\noperating system, and how to create your first Streamlit app!\n\n\n helps you set up your development environment. Walk through installing Streamlit on Windows, macOS, or Linux. Alternatively, code right in your browser with GitHub Codespaces or Streamlit in Snowflake.\n introduces you to Streamlit's data model and development flow. You'll learn what makes Streamlit the most powerful way to build data apps, including the ability to display and style data, draw charts and maps, add interactive widgets, customize app layouts, cache computation, and define themes.\n walks you through creating apps using core features to fetch and cache data, draw charts, plot information on a map, and use interactive widgets to filter results.\n if you want to skip past local installation and code right in your browser. This guide uses Streamlit Community Cloud to help you automatically configure a codespace.\n\n\n" - }, - { - "url": "https://docs.streamlit.io/get-started/fundamentals/summary", - "content": "# App model summary\n\nNow that you know a little more about all the individual pieces, let's close\nthe loop and review how it works together:\n\n1. Streamlit apps are Python scripts that run from top to bottom.\n1. Every time a user opens a browser tab pointing to your app, the script is executed and a new session starts.\n1. As the script executes, Streamlit draws its output live in a browser.\n1. Every time a user interacts with a widget, your script is re-executed and Streamlit redraws its output in the browser.\n - The output value of that widget matches the new value during that rerun.\n1. Scripts use the Streamlit cache to avoid recomputing expensive functions, so updates happen very fast.\n1. Session State lets you save information that persists between reruns when you need more than a simple widget.\n1. Streamlit apps can contain multiple pages, which are defined in separate `.py` files in a `pages` folder.\n\n![The Streamlit app model](/images/app_model.png)" - }, - { - "url": "https://docs.streamlit.io/get-started/fundamentals/main-concepts", - "content": "# Basic concepts of Streamlit\n\nWorking with Streamlit is simple. First you sprinkle a few Streamlit commands\ninto a normal Python script, then you run it with `streamlit run`:\n\n```bash\nstreamlit run your_script.py [-- script args]\n```\n\nAs soon as you run the script as shown above, a local Streamlit server will\nspin up and your app will open in a new tab in your default web browser. The app\nis your canvas, where you'll draw charts, text, widgets, tables, and more.\n\nWhat gets drawn in the app is up to you. For example\n[`st.text`](/develop/api-reference/text/st.text) writes raw text to your app, and\n[`st.line_chart`](/develop/api-reference/charts/st.line_chart) draws — you guessed it — a\nline chart. Refer to our [API documentation](/develop/api-reference) to see all commands that\nare available to you.\n\n\n\nWhen passing your script some custom arguments, they must be passed after two dashes. Otherwise the\narguments get interpreted as arguments to Streamlit itself.\n\n\n\nAnother way of running Streamlit is to run it as a Python module. This can be\nuseful when configuring an IDE like PyCharm to work with Streamlit:\n\n```bash\n# Running\npython -m streamlit run your_script.py\n\n# is equivalent to:\nstreamlit run your_script.py\n```\n\n\n\nYou can also pass a URL to `streamlit run`! This is great when combined with\nGitHub Gists. For example:\n\n```bash\nstreamlit run https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/streamlit_app.py\n```\n\n\n\n## Development flow\n\nEvery time you want to update your app, save the source file. When you do\nthat, Streamlit detects if there is a change and asks you whether you want to\nrerun your app. Choose \"Always rerun\" at the top-right of your screen to\nautomatically update your app every time you change its source code.\n\nThis allows you to work in a fast interactive loop: you type some code, save\nit, try it out live, then type some more code, save it, try it out, and so on\nuntil you're happy with the results. This tight loop between coding and viewing\nresults live is one of the ways Streamlit makes your life easier.\n\n\n\nWhile developing a Streamlit app, it's recommended to lay out your editor and\nbrowser windows side by side, so the code and the app can be seen at the same\ntime. Give it a try!\n\n\n\nAs of Streamlit version 1.10.0 and higher, Streamlit apps cannot be run from the root directory of Linux distributions. If you try to run a Streamlit app from the root directory, Streamlit will throw a `FileNotFoundError: [Errno 2] No such file or directory` error. For more information, see GitHub issue [#5239](https://github.com/streamlit/streamlit/issues/5239).\n\nIf you are using Streamlit version 1.10.0 or higher, your main script should live in a directory other than the root directory. When using Docker, you can use the `WORKDIR` command to specify the directory where your main script lives. For an example of how to do this, read [Create a Dockerfile](/deploy/tutorials/docker#create-a-dockerfile).\n\n## Data flow\n\nStreamlit's architecture allows you to write apps the same way you write plain\nPython scripts. To unlock this, Streamlit apps have a unique data flow: any\ntime something must be updated on the screen, Streamlit reruns your entire\nPython script from top to bottom.\n\nThis can happen in two situations:\n\n- Whenever you modify your app's source code.\n\n- Whenever a user interacts with widgets in the app. For example, when dragging\n a slider, entering text in an input box, or clicking a button.\n\nWhenever a callback is passed to a widget via the `on_change` (or `on_click`) parameter, the callback will always run before the rest of your script. For details on the Callbacks API, please refer to our [Session State API Reference Guide](/develop/api-reference/caching-and-state/st.session_state#use-callbacks-to-update-session-state).\n\nAnd to make all of this fast and seamless, Streamlit does some heavy lifting\nfor you behind the scenes. A big player in this story is the\n[`@st.cache_data`](#caching) decorator, which allows developers to skip certain\ncostly computations when their apps rerun. We'll cover caching later in this\npage.\n\n## Display and style data\n\nThere are a few ways to display data (tables, arrays, data frames) in Streamlit\napps. [Below](#use-magic), you will be introduced to _magic_\nand [`st.write()`](/develop/api-reference/write-magic/st.write), which can be used to write\nanything from text to tables. After that, let's take a look at methods designed\nspecifically for visualizing data.\n\n### Use magic\n\nYou can also write to your app without calling any Streamlit methods.\nStreamlit supports \"[magic commands](/develop/api-reference/write-magic/magic),\" which means you don't have to use\n[`st.write()`](/develop/api-reference/write-magic/st.write) at all! To see this in action try this snippet:\n\n```python\n\"\"\"\n# My first app\nHere's our first attempt at using data to create a table:\n\"\"\"\n\nimport streamlit as st\nimport pandas as pd\ndf = pd.DataFrame({\n 'first column': [1, 2, 3, 4],\n 'second column': [10, 20, 30, 40]\n})\n\ndf\n```\n\nAny time that Streamlit sees a variable or a literal\nvalue on its own line, it automatically writes that to your app using\n[`st.write()`](/develop/api-reference/write-magic/st.write). For more information, refer to the\ndocumentation on [magic commands](/develop/api-reference/write-magic/magic).\n\n### Write a data frame\n\nAlong with [magic commands](/develop/api-reference/write-magic/magic),\n[`st.write()`](/develop/api-reference/write-magic/st.write) is Streamlit's \"Swiss Army knife\". You\ncan pass almost anything to [`st.write()`](/develop/api-reference/write-magic/st.write):\ntext, data, Matplotlib figures, Altair charts, and more. Don't worry, Streamlit\nwill figure it out and render things the right way.\n\n```python\nimport streamlit as st\nimport pandas as pd\n\nst.write(\"Here's our first attempt at using data to create a table:\")\nst.write(pd.DataFrame({\n 'first column': [1, 2, 3, 4],\n 'second column': [10, 20, 30, 40]\n}))\n```\n\nThere are other data specific functions like\n[`st.dataframe()`](/develop/api-reference/data/st.dataframe) and\n[`st.table()`](/develop/api-reference/data/st.table) that you can also use for displaying\ndata. Let's understand when to use these features and how to add colors and styling to your data frames.\n\nYou might be asking yourself, \"why wouldn't I always use `st.write()`?\" There are\na few reasons:\n\n1. _Magic_ and [`st.write()`](/develop/api-reference/write-magic/st.write) inspect the type of\n data that you've passed in, and then decide how to best render it in the\n app. Sometimes you want to draw it another way. For example, instead of\n drawing a dataframe as an interactive table, you may want to draw it as a\n static table by using `st.table(df)`.\n2. The second reason is that other methods return an object that can be used\n and modified, either by adding data to it or replacing it.\n3. Finally, if you use a more specific Streamlit method you can pass additional\n arguments to customize its behavior.\n\nFor example, let's create a data frame and change its formatting with a Pandas\n`Styler` object. In this example, you'll use Numpy to generate a random sample,\nand the [`st.dataframe()`](/develop/api-reference/data/st.dataframe) method to draw an\ninteractive table.\n\n\n\nThis example uses Numpy to generate a random sample, but you can use Pandas\nDataFrames, Numpy arrays, or plain Python arrays.\n\n\n\n```python\nimport streamlit as st\nimport numpy as np\n\ndataframe = np.random.randn(10, 20)\nst.dataframe(dataframe)\n```\n\nLet's expand on the first example using the Pandas `Styler` object to highlight\nsome elements in the interactive table.\n\n```python\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\n\ndataframe = pd.DataFrame(\n np.random.randn(10, 20),\n columns=('col %d' % i for i in range(20)))\n\nst.dataframe(dataframe.style.highlight_max(axis=0))\n```\n\nStreamlit also has a method for static table generation:\n[`st.table()`](/develop/api-reference/data/st.table).\n\n```python\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\n\ndataframe = pd.DataFrame(\n np.random.randn(10, 20),\n columns=('col %d' % i for i in range(20)))\nst.table(dataframe)\n```\n\n### Draw charts and maps\n\nStreamlit supports several popular data charting libraries like [Matplotlib,\nAltair, deck.gl, and more](/develop/api-reference#chart-elements). In this section, you'll\nadd a bar chart, line chart, and a map to your app.\n\n### Draw a line chart\n\nYou can easily add a line chart to your app with\n[`st.line_chart()`](/develop/api-reference/charts/st.line_chart). We'll generate a random\nsample using Numpy and then chart it.\n\n```python\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\n\nchart_data = pd.DataFrame(\n np.random.randn(20, 3),\n columns=['a', 'b', 'c'])\n\nst.line_chart(chart_data)\n```\n\n### Plot a map\n\nWith [`st.map()`](/develop/api-reference/charts/st.map) you can display data points on a map.\nLet's use Numpy to generate some sample data and plot it on a map of\nSan Francisco.\n\n```python\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\n\nmap_data = pd.DataFrame(\n np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],\n columns=['lat', 'lon'])\n\nst.map(map_data)\n```\n\n## Widgets\n\nWhen you've got the data or model into the state that you want to explore, you\ncan add in widgets like [`st.slider()`](/develop/api-reference/widgets/st.slider),\n[`st.button()`](/develop/api-reference/widgets/st.button) or\n[`st.selectbox()`](/develop/api-reference/widgets/st.selectbox). It's really straightforward\n— treat widgets as variables:\n\n```python\nimport streamlit as st\nx = st.slider('x') # 👈 this is a widget\nst.write(x, 'squared is', x * x)\n```\n\nOn first run, the app above should output the text \"0 squared is 0\". Then\nevery time a user interacts with a widget, Streamlit simply reruns your script\nfrom top to bottom, assigning the current state of the widget to your variable\nin the process.\n\nFor example, if the user moves the slider to position `10`, Streamlit will\nrerun the code above and set `x` to `10` accordingly. So now you should see the\ntext \"10 squared is 100\".\n\nWidgets can also be accessed by key, if you choose to specify a string to use as the unique key for the widget:\n\n```python\nimport streamlit as st\nst.text_input(\"Your name\", key=\"name\")\n\n# You can access the value at any point with:\nst.session_state.name\n```\n\nEvery widget with a key is automatically added to Session State. For more information about Session State, its association with widget state, and its limitations, see [Session State API Reference Guide](/develop/api-reference/caching-and-state/st.session_state).\n\n### Use checkboxes to show/hide data\n\nOne use case for checkboxes is to hide or show a specific chart or section in\nan app. [`st.checkbox()`](/develop/api-reference/widgets/st.checkbox) takes a single argument,\nwhich is the widget label. In this sample, the checkbox is used to toggle a\nconditional statement.\n\n```python\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\n\nif st.checkbox('Show dataframe'):\n chart_data = pd.DataFrame(\n np.random.randn(20, 3),\n columns=['a', 'b', 'c'])\n\n chart_data\n```\n\n### Use a selectbox for options\n\nUse [`st.selectbox`](/develop/api-reference/widgets/st.selectbox) to choose from a series. You\ncan write in the options you want, or pass through an array or data frame\ncolumn.\n\nLet's use the `df` data frame we created earlier.\n\n```python\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.DataFrame({\n 'first column': [1, 2, 3, 4],\n 'second column': [10, 20, 30, 40]\n })\n\noption = st.selectbox(\n 'Which number do you like best?',\n df['first column'])\n\n'You selected: ', option\n```\n\n## Layout\n\nStreamlit makes it easy to organize your widgets in a left panel sidebar with\n[`st.sidebar`](/develop/api-reference/layout/st.sidebar). Each element that's passed to\n[`st.sidebar`](/develop/api-reference/layout/st.sidebar) is pinned to the left, allowing\nusers to focus on the content in your app while still having access to UI\ncontrols.\n\nFor example, if you want to add a selectbox and a slider to a sidebar,\nuse `st.sidebar.slider` and `st.sidebar.selectbox` instead of `st.slider` and\n`st.selectbox`:\n\n```python\nimport streamlit as st\n\n# Add a selectbox to the sidebar:\nadd_selectbox = st.sidebar.selectbox(\n 'How would you like to be contacted?',\n ('Email', 'Home phone', 'Mobile phone')\n)\n\n# Add a slider to the sidebar:\nadd_slider = st.sidebar.slider(\n 'Select a range of values',\n 0.0, 100.0, (25.0, 75.0)\n)\n```\n\nBeyond the sidebar, Streamlit offers several other ways to control the layout\nof your app. [`st.columns`](/develop/api-reference/layout/st.columns) lets you place widgets side-by-side, and\n[`st.expander`](/develop/api-reference/layout/st.expander) lets you conserve space by hiding away large content.\n\n```python\nimport streamlit as st\n\nleft_column, right_column = st.columns(2)\n# You can use a column just like st.sidebar:\nleft_column.button('Press me!')\n\n# Or even better, call Streamlit functions inside a \"with\" block:\nwith right_column:\n chosen = st.radio(\n 'Sorting hat',\n (\"Gryffindor\", \"Ravenclaw\", \"Hufflepuff\", \"Slytherin\"))\n st.write(f\"You are in {chosen} house!\")\n```\n\n\n\n`st.echo` and `st.spinner` are not currently supported inside the sidebar\nor layout options. Rest assured, though, we're currently working on adding support for those too!\n\n\n\n### Show progress\n\nWhen adding long running computations to an app, you can use\n[`st.progress()`](/develop/api-reference/status/st.progress) to display status in real time.\n\nFirst, let's import time. We're going to use the `time.sleep()` method to\nsimulate a long running computation:\n\n```python\nimport time\n```\n\nNow, let's create a progress bar:\n\n```python\nimport streamlit as st\nimport time\n\n'Starting a long computation...'\n\n# Add a placeholder\nlatest_iteration = st.empty()\nbar = st.progress(0)\n\nfor i in range(100):\n # Update the progress bar with each iteration.\n latest_iteration.text(f'Iteration {i+1}')\n bar.progress(i + 1)\n time.sleep(0.1)\n\n'...and now we\\'re done!'\n```" - }, - { - "url": "https://docs.streamlit.io/get-started/fundamentals/additional-features", - "content": "# Additional Streamlit features\n\nSo you've read all about Streamlit's [Basic concepts](/get-started/fundamentals/main-concepts) and gotten a taste of caching and Session State in [Advanced concepts](/get-started/fundamentals/advanced-concepts). But what about the bells and whistles? Here's a quick look at some extra features to take your app to the next level.\n\n## Theming\n\nStreamlit supports Light and Dark themes out of the box. Streamlit will first\ncheck if the user viewing an app has a Light or Dark mode preference set by\ntheir operating system and browser. If so, then that preference will be used.\nOtherwise, the Light theme is applied by default.\n\nYou can also change the active theme from \"⋮\" → \"Settings\".\n\n![Changing Themes](/images/change_theme.gif)\n\nWant to add your own theme to an app? The \"Settings\" menu has a theme editor\naccessible by clicking on \"Edit active theme\". You can use this editor to try\nout different colors and see your app update live.\n\n![Editing Themes](/images/edit_theme.gif)\n\nWhen you're happy with your work, themes can be saved by\n[setting config options](/develop/concepts/configuration)\nin the `[theme]` config section. After you've defined a theme for your app, it\nwill appear as \"Custom Theme\" in the theme selector and will be applied by\ndefault instead of the included Light and Dark themes.\n\nMore information about the options available when defining a theme can be found\nin the [theme option documentation](/develop/concepts/configuration/theming).\n\n\n\nThe theme editor menu is available only in local development. If you've deployed your app using\nStreamlit Community Cloud, the \"Edit active theme\" button will no longer be displayed in the \"Settings\"\nmenu.\n\n\n\n\n\nAnother way to experiment with different theme colors is to turn on the \"Run on save\" option, edit\nyour config.toml file, and watch as your app reruns with the new theme colors applied.\n\n\n\n## Pages\n\nAs apps grow large, it becomes useful to organize them into multiple pages. This makes the app easier to manage as a developer and easier to navigate as a user. Streamlit provides a powerful way to create multipage apps using [`st.Page`](/develop/api-reference/navigation/st.page) and [`st.navigation`](/develop/api-reference/navigation/st.navigation). Just create your pages and connect them with navigation as follows:\n\n1. Create an entry point script that defines and connects your pages\n2. Create separate Python files for each page's content\n3. Use [`st.Page`](/develop/api-reference/navigation/st.page) to define your pages and [`st.navigation`](/develop/api-reference/navigation/st.navigation) to connect them\n\nHere's an example of a three-page app:\n\n
\nstreamlit_app.py\n\n```python\nimport streamlit as st\n\n# Define the pages\nmain_page = st.Page(\"main_page.py\", title=\"Main Page\", icon=\"🎈\")\npage_2 = st.Page(\"page_2.py\", title=\"Page 2\", icon=\"❄️\")\npage_3 = st.Page(\"page_3.py\", title=\"Page 3\", icon=\"🎉\")\n\n# Set up navigation\npg = st.navigation([main_page, page_2, page_3])\n\n# Run the selected page\npg.run()\n```\n\n
\n\n
\nmain_page.py\n\n```python\nimport streamlit as st\n\n# Main page content\nst.markdown(\"# Main page 🎈\")\nst.sidebar.markdown(\"# Main page 🎈\")\n```\n\n
\n\n
\npage_2.py\n\n```python\nimport streamlit as st\n\nst.markdown(\"# Page 2 ❄️\")\nst.sidebar.markdown(\"# Page 2 ❄️\")\n```\n\n
\n\n
\npage_3.py\n\n```python\nimport streamlit as st\n\nst.markdown(\"# Page 3 🎉\")\nst.sidebar.markdown(\"# Page 3 🎉\")\n```\n\n
\n
\n\nNow run `streamlit run streamlit_app.py` and view your shiny new multipage app! The navigation menu will automatically appear, allowing users to switch between pages.\n\n\n\nOur documentation on [Multipage apps](/develop/concepts/multipage-apps) teaches you how to add pages to your app, including how to define pages, structure and run multipage apps, and navigate between pages. Once you understand the basics, [create your first multipage app](/get-started/tutorials/create-a-multipage-app)!\n\n## Custom components\n\nIf you can't find the right component within the Streamlit library, try out custom components to extend Streamlit's built-in functionality. Explore and browse through popular, community-created components in the [Components gallery](https://streamlit.io/components). If you dabble in frontend development, you can build your own custom component with Streamlit's [components API](/develop/concepts/custom-components/intro).\n\n## Static file serving\n\nAs you learned in Streamlit fundamentals, Streamlit runs a server that clients connect to. That means viewers of your app don't have direct access to the files which are local to your app. Most of the time, this doesn't matter because Streamlt commands handle that for you. When you use `st.image()` your Streamlit server will access the file and handle the necessary hosting so your app viewers can see it. However, if you want a direct URL to an image or file you'll need to host it. This requires setting the correct configuration and placing your hosted files in a directory named `static`. For example, your project could look like:\n\n```bash\nyour-project/\n├── static/\n│ └── my_hosted-image.png\n└── streamlit_app.py\n```\n\nTo learn more, read our guide on [Static file serving](/develop/concepts/configuration/serving-static-files).\n\n## App testing\n\nGood development hygiene includes testing your code. Automated testing allows you to write higher quality code, faster! Streamlit has a built-in testing framework that let's you build tests easily. Use your favorite testing framework to run your tests. We like [`pytest`](https://pypi.org/project/pytest/). When you test a Streamlit app, you simulate running the app, declare user input, and inspect the results. You can use GitHub workflows to automate your tests and get instant alerts about breaking changes. Learn more in our guide to [App testing](/develop/concepts/app-testing)." - }, - { - "url": "https://docs.streamlit.io/get-started/fundamentals", - "content": "# Fundamental concepts\n\nAre you new to Streamlit and want the grand tour? If so, you're in the right place!\n\n\n Learn the fundamental concepts of Streamlit. How is a Streamlit app structured? How does it run? How does it magically get your data on a webpage?\n After you understand the rerun logic of Streamlit, learn how to make efficient and dynamic apps with caching and Session State. Get introduced to handling database connections.\n Learn about Streamlit's additional features. You don't need to know these concepts for your first app, but check it out to know what's available.\n" - }, - { - "url": "https://docs.streamlit.io/get-started/fundamentals/advanced-concepts", - "content": "# Advanced concepts of Streamlit\n\nNow that you know how a Streamlit app runs and handles data, let's talk about being efficient. Caching allows you to save the output of a function so you can skip over it on rerun. Session State lets you save information for each user that is preserved between reruns. This not only allows you to avoid unecessary recalculation, but also allows you to create dynamic pages and handle progressive processes.\n\n## Caching\n\nCaching allows your app to stay performant even when loading data from the web, manipulating large datasets, or performing expensive computations.\n\nThe basic idea behind caching is to store the results of expensive function calls and return the cached result when the same inputs occur again. This avoids repeated execution of a function with the same input values.\n\nTo cache a function in Streamlit, you need to apply a caching decorator to it. You have two choices:\n\n- `st.cache_data` is the recommended way to cache computations that return data. Use `st.cache_data` when you use a function that returns a serializable data object (e.g. str, int, float, DataFrame, dict, list). **It creates a new copy of the data at each function call**, making it safe against [mutations and race conditions](/develop/concepts/architecture/caching#mutation-and-concurrency-issues). The behavior of `st.cache_data` is what you want in most cases – so if you're unsure, start with `st.cache_data` and see if it works!\n- `st.cache_resource` is the recommended way to cache global resources like ML models or database connections. Use `st.cache_resource` when your function returns unserializable objects that you don’t want to load multiple times. **It returns the cached object itself**, which is shared across all reruns and sessions without copying or duplication. If you mutate an object that is cached using `st.cache_resource`, that mutation will exist across all reruns and sessions.\n\nExample:\n\n```python\n@st.cache_data\ndef long_running_function(param1, param2):\n return …\n```\n\nIn the above example, `long_running_function` is decorated with `@st.cache_data`. As a result, Streamlit notes the following:\n\n- The name of the function (`\"long_running_function\"`).\n- The value of the inputs (`param1`, `param2`).\n- The code within the function.\n\nBefore running the code within `long_running_function`, Streamlit checks its cache for a previously saved result. If it finds a cached result for the given function and input values, it will return that cached result and not rerun function's code. Otherwise, Streamlit executes the function, saves the result in its cache, and proceeds with the script run. During development, the cache updates automatically as the function code changes, ensuring that the latest changes are reflected in the cache.\n\n\"Streamlit's\n\nFor more information about the Streamlit caching decorators, their configuration parameters, and their limitations, see [Caching](/develop/concepts/architecture/caching).\n\n## Session State\n\nSession State provides a dictionary-like interface where you can save information that is preserved between script reruns. Use `st.session_state` with key or attribute notation to store and recall values. For example, `st.session_state[\"my_key\"]` or `st.session_state.my_key`. Remember that widgets handle their statefulness all by themselves, so you won't always need to use Session State!\n\n### What is a session?\n\nA session is a single instance of viewing an app. If you view an app from two different tabs in your browser, each tab will have its own session. So each viewer of an app will have a Session State tied to their specific view. Streamlit maintains this session as the user interacts with the app. If the user refreshes their browser page or reloads the URL to the app, their Session State resets and they begin again with a new session.\n\n### Examples of using Session State\n\nHere's a simple app that counts the number of times the page has been run. Every time you click the button, the script will rerun.\n\n```python\nimport streamlit as st\n\nif \"counter\" not in st.session_state:\n st.session_state.counter = 0\n\nst.session_state.counter += 1\n\nst.header(f\"This page has run {st.session_state.counter} times.\")\nst.button(\"Run it again\")\n```\n\n- **First run:** The first time the app runs for each user, Session State is empty. Therefore, a key-value pair is created (`\"counter\":0`). As the script continues, the counter is immediately incremented (`\"counter\":1`) and the result is displayed: \"This page has run 1 times.\" When the page has fully rendered, the script has finished and the Streamlit server waits for the user to do something. When that user clicks the button, a rerun begins.\n\n- **Second run:** Since \"counter\" is already a key in Session State, it is not reinitialized. As the script continues, the counter is incremented (`\"counter\":2`) and the result is displayed: \"This page has run 2 times.\"\n\nThere are a few common scenarios where Session State is helpful. As demonstrated above, Session State is used when you have a progressive process that you want to build upon from one rerun to the next. Session State can also be used to prevent recalculation, similar to caching. However, the differences are important:\n\n- Caching associates stored values to specific functions and inputs. Cached values are accessible to all users across all sessions.\n- Session State associates stored values to keys (strings). Values in session state are only available in the single session where it was saved.\n\nIf you have random number generation in your app, you'd likely use Session State. Here's an example where data is generated randomly at the beginning of each session. By saving this random information in Session State, each user gets different random data when they open the app but it won't keep changing on them as they interact with it. If you select different colors with the picker you'll see that the data does not get re-randomized with each rerun. (If you open the app in a new tab to start a new session, you'll see different data!)\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nif \"df\" not in st.session_state:\n st.session_state.df = pd.DataFrame(np.random.randn(20, 2), columns=[\"x\", \"y\"])\n\nst.header(\"Choose a datapoint color\")\ncolor = st.color_picker(\"Color\", \"#FF0000\")\nst.divider()\nst.scatter_chart(st.session_state.df, x=\"x\", y=\"y\", color=color)\n```\n\nIf you are pulling the same data for all users, you'd likely cache a function that retrieves that data. On the other hand, if you pull data specific to a user, such as querying their personal information, you may want to save that in Session State. That way, the queried data is only available in that one session.\n\nAs mentioned in [Basic concepts](/get-started/fundamentals/main-concepts#widgets), Session State is also related to widgets. Widgets are magical and handle statefulness quietly on their own. As an advanced feature however, you can manipulate the value of widgets within your code by assigning keys to them. Any key assigned to a widget becomes a key in Session State tied to the value of the widget. This can be used to manipulate the widget. After you finish understanding the basics of Streamlit, check out our guide on [Widget behavior](/develop/concepts/architecture/widget-behavior) to dig in the details if you're interested.\n\n## Connections\n\nAs hinted above, you can use `@st.cache_resource` to cache connections. This is the most general solution which allows you to use almost any connection from any Python library. However, Streamlit also offers a convenient way to handle some of the most popular connections, like SQL! `st.connection` takes care of the caching for you so you can enjoy fewer lines of code. Getting data from your database can be as easy as:\n\n```python\nimport streamlit as st\n\nconn = st.connection(\"my_database\")\ndf = conn.query(\"select * from my_table\")\nst.dataframe(df)\n```\n\nOf course, you may be wondering where your username and password go. Streamlit has a convenient mechanism for [Secrets management](/develop/concepts/connections/secrets-management). For now, let's just see how `st.connection` works very nicely with secrets. In your local project directory, you can save a `.streamlit/secrets.toml` file. You save your secrets in the toml file and `st.connection` just uses them! For example, if you have an app file `streamlit_app.py` your project directory may look like this:\n\n```bash\nyour-LOCAL-repository/\n├── .streamlit/\n│ └── secrets.toml # Make sure to gitignore this!\n└── streamlit_app.py\n```\n\nFor the above SQL example, your `secrets.toml` file might look like the following:\n\n```toml\n[connections.my_database]\n type=\"sql\"\n dialect=\"mysql\"\n username=\"xxx\"\n password=\"xxx\"\n host=\"example.com\" # IP or URL\n port=3306 # Port number\n database=\"mydb\" # Database name\n```\n\nSince you don't want to commit your `secrets.toml` file to your repository, you'll need to learn how your host handles secrets when you're ready to publish your app. Each host platform may have a different way for you to pass your secrets. If you use Streamlit Community Cloud for example, each deployed app has a settings menu where you can load your secrets. After you've written an app and are ready to deploy, you can read all about how to [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app) on Community Cloud." - }, - { - "url": "https://docs.streamlit.io/get-started/installation/anaconda-distribution", - "content": "# Install Streamlit using Anaconda Distribution\n\nThis page walks you through installing Streamlit locally using Anaconda Distribution. At the end, you'll build a simple \"Hello world\" app and run it. You can read more about [Getting started with Anaconda Distribution](https://docs.anaconda.com/free/anaconda/getting-started/) in Anaconda's docs. If you prefer to manage your Python environments via command line, check out how to [Install Streamlit using command line](/get-started/installation/command-line).\n\n## Prerequisites\n\n1. **A code editor**\n\n Anaconda Distribution includes Python and basically everything you need to get started.\n The only thing left for you to choose is a code editor.\n\n Our favorite editor is [VS Code](https://code.visualstudio.com/download), which is also what we\n use in all our tutorials.\n\n1. **Knowledge about environment managers**\n\n Environment managers create virtual environments to isolate Python package installations between\n projects. For a detailed introduction to Python environments, check out\n [Python Virtual Environments: A Primer](https://realpython.com/python-virtual-environments-a-primer/).\n\n But don't worry! In this guide we'll teach you how to install and use an environment manager\n (Anaconda).\n\n## Install Anaconda Distribution\n\n1. Go to [anaconda.com/download](https://www.anaconda.com/download).\n\n2. Install Anaconda Distribution for your OS.\n\n## Create an environment using Anaconda Navigator\n\n3. Open Anaconda Navigator (the graphical interface included with Anaconda Distribution).\n\n4. You can decline signing in to Anaconda if prompted.\n\n5. In the left menu, click \"**Environments**.\"\n ![Open your environments list in Anaconda Navigator](/images/get-started/Anaconda-Navigator-environment-1.png)\n\n6. At the bottom of your environments list, click \"**Create**.\"\n ![Click \"Create\" to open the Create new environment dialog](/images/get-started/Anaconda-Navigator-environment-2-create.png)\n\n7. Enter \"streamlitenv\" for the name of your environment.\n\n8. Click \"**Create**.\"\n
\n \"Finalize\n
\n\n## Activate your environment\n\n9. Click the green play icon (play_circle) next to your environment.\n\n10. Click \"**Open Terminal**.\"\n ![Open a new terminal with your environment activated](/images/get-started/Anaconda-Navigator-environment-6-activate.png)\n\n11. A terminal will open with your environment activated. Your environment's name will appear in parentheses at the beginning of your terminal's prompt to show that it's activated.\n\n## Install Streamlit in your environment\n\n12. In your terminal, type:\n\n ```bash\n pip install streamlit\n ```\n\n13. To validate your installation, enter:\n\n ```bash\n streamlit hello\n ```\n\n If this doesn't work, use the long-form command:\n\n ```bash\n python -m streamlit hello\n ```\n\n14. The Streamlit Hello example app will automatically open in your browser. If it doesn't, open your browser and go to the localhost address indicated in your terminal, typically `http://localhost:8501`. Play around with the app!\n\n15. Close your terminal.\n\n## Create a `Hello World` app and run it\n\n17. Open VS Code with a new project.\n\n18. Create a Python file named `app.py` in your project folder.\n ![Create a new file called app.py](/images/get-started/hello-world-1-new-file.png)\n\n19. Copy the following code into `app.py` and save it.\n\n ```python\n import streamlit as st\n\n st.write(\"Hello World\")\n ```\n\n20. Click your Python interpreter in the lower-right corner, then choose your `streamlitenv` environment from the drop-down.\n ![Set your Python interpreter to your `streamlitenv` environment](/images/get-started/hello-world-3-change-interpreter.png)\n\n21. Right-click `app.py` in your file navigation and click \"**Open in integrated terminal**.\"\n ![Open your terminal in your project folder](/images/get-started/hello-world-4-open-terminal.png)\n\n22. A terminal will open with your environment activated. Confirm this by looking for \"(streamlitenv)\" at the beginning of your next prompt.\n If it is not there, manually activate your environment with the command:\n\n ```bash\n conda activate streamlitenv\n ```\n\n23. In your terminal, type:\n\n ```bash\n streamlit run app.py\n ```\n\n If this doesn't work, use the long-form command:\n\n ```bash\n python -m streamlit run app.py\n ```\n\n ![Start your Streamlit app with `streamlit run app.py`](/images/get-started/hello-world-5-streamlit-run.png)\n\n24. Your app will automatically open in your browser. If it doesn't for any reason, open your browser and go to the localhost address indicated in your terminal, typically `http://localhost:8501`.\n\n25. Change `st.write` to `st.title` and save your file:\n\n ```python\n import streamlit as st\n\n st.title(\"Hello World\")\n ```\n\n26. In your browser, click \"**Always rerun**\" to instantly rerun your app whenever you save a change to your file.\n ![Automatically rerun your app when your source file changes](/images/get-started/hello-world-6-always-rerun.png)\n\n27. Your app will update! Keep making changes and you will see your changes as soon as you save your file.\n ![Your app updates when you resave your source file](/images/get-started/hello-world-7-updated-app.png)\n\n28. When you're done, you can stop your app with `Ctrl+C` in your terminal or just by closing your terminal.\n\n## What's next?\n\nRead about our [Basic concepts](/get-started/fundamentals/main-concepts) and try out more commands in your app." - }, - { - "url": "https://docs.streamlit.io/get-started/installation/streamlit-in-snowflake", - "content": "# Use Streamlit in Snowflake to code in a secure environment\n\nSnowflake is a single, global platform that powers the Data Cloud. If you want to use a secure platform with role-based access control, this is the option for you! This page walks you through creating a trial Snowflake account and building a \"Hello world\" app. Your trial account comes with an account credit so you can try out the service without entering any payment information.\n\n\n\nFor more information, see [Limitations and unsupported features](https://docs.snowflake.com/en/developer-guide/streamlit/limitations) in the Snowflake documentation.\n\n\n\n## Prerequisites\n\nAll you need is an email address! Everything else happens in your 30-day trial account.\n\n## Create an account\n\n1. Go to . (This link will open in a new tab.)\n\n1. Fill in your information, and click \"**CONTINUE**.\"\n\n1. Select \"**Standard**\" for your Snowflake edition and \"**Amazon Web Services**\" for your cloud provider.\n\n1. Choose the region nearest you, accept the terms, and click \"**GET STARTED**.\"\n\n
\n \"Choose\n
\n\n1. Answer a few questions to let us know more about yourself, or skip them.\n\n1. A message will display: \"You're now signed up!\" Go to your email, and click on the activation link. (Within your link, note the subdomain. This is your Snowflake account identifier. `https://.snowflakecomputing.com`)\n\n1. Set your username and password. This will be an admin user account within your Snowflake account. Your Snowflake account can have multiple users within it.\n\n1. If you are not signed in after setting your password, follow the instructions to enter your Snowflake account identifier, and then enter your username and password. If you've accidentally closed your browser, you can sign in at [app.snowflake.com](https://app.snowflake.com/).\n\nCongratulations! You have a trial Snowflake account.\n\nThe displayed interface is called Snowsight. Snowsight provides a web-based, graphical user interface for your Snowflake account. The default page is \"**Home**,\" which provides popular quick actions to get started. You can access your \"**Projects**\" in the left navigation or at the bottom of your \"**Home**\" page. \"**Projects**\" include worksheets, notebooks, Streamlit apps, and dashboards. Check out the Snowflake docs for a [quick tour](https://docs.snowflake.com/en/user-guide/ui-snowsight-quick-tour).)\n\n![Sample databases in your new trial Snowflake account](/images/get-started/SiS-1-landing-page.png)\n\n## Optional: Create a warehouse\n\nWarehouses provide compute resources for tasks and apps in your Snowflake account. Your trial account already has an XS warehouse which you can use. This is named \"COMPUTE_WH.\" However, if you want to use more compute resources, you can create another warehouse.\n\n1. In the lower-left corner under your name, confirm that your current role is \"ACCOUNTADMIN.\" If it isn't, click your name, hover over \"**Switch Role**,\" and select \"**ACCOUNTADMIN**.\"\n\n1. In the left navigation, select \"**Admin**\" → \"**Warehouses**.\"\n\n1. In the upper-right corner, click the blue \"add **Warehouse**\" button.\n\n1. Enter \"STREAMLIT_WH\" for the name and select a type and size. The default type and size are \"Standard\" and \"X-Small,\" respectively. Click \"**Create Warehouse**.\"\n\n## Create a database\n\nDatabases provide storage for data and apps in your Snowflake account. Your trial account comes with a shared database of sample data, but you must create a new database in your account to store your app files.\n\n1. In the left navigation, select \"**Data**\" → \"**Databases**.\"\n\n1. In the upper-right corner, click the blue \"add **Database**\" button.\n\n1. Enter \"STREAMLIT_DB\" for the name, and click \"**Create**.\"\n\nYay! You now have a new database to hold all your Streamlit apps.\n\n![New database in your new trial Snowflake account](/images/get-started/SiS-2-databases.png)\n\nThe databases in the above screenshot are as follows:\n\n- \"SNOWFLAKE:\" A built-in database that stores meta data for your account.\n- \"SNOWFLAKE_SAMPLE_DATA:\" A shared database with sample data.\n- \"STREAMLIT_DB:\" Your new database where you'll put your Streamlit files.\n\n## Create a \"Hello World\" Streamlit app\n\n1. In the left navigation, select \"**Projects**\" → \"**Streamlit**.\"\n\n1. In the upper-right corner, click the blue \"add **Streamlit App**\" button.\n\n1. Enter your app details as follows:\n\n - App title: \"Hello World\"\n - App location: \"STREAMLIT_DB\" and \"PUBLIC\"\n - App warehouse: \"COMPUTE_WH\" (default) or \"STREAMLIT_WH\" (if you created a new warehouse)\n\n If you can't select your database, refresh the page to ensure that the interface is displaying current information.\n\n1. Click \"**Create**.\" (Note that the app will run with the rights of \"ACCOUNTADMIN\" for simplicity. You can curate your roles and permissions to choose who can create and access apps.)\n\n ![Create your first Streamlit in Snowflake app](/images/get-started/SiS-3-create-app.png)\n\n Your new app is prefilled with example code and opens in editing mode. The left panel shows your code. The right panel shows the resulting app.\n\n1. Optional: Explore the example app.\n\n1. In the left code editor, delete everything, and replace it with the following:\n\n ```python\n import streamlit as st\n\n st.write(\"Hello World\")\n ```\n\n If you want to return to the sample code later, you can always make another app to edit the same example again.\n\n1. In the upper-right corner, click the blue \"play_arrow **Run**\" button to make the running app reflect your changes.\n\n Hooray! You just wrote a Streamlit app.\n\n ![Hello World in Streamlit in Snowflake app](/images/get-started/SiS-4-hello-world.png)\n\n \n\n In the lower-left corner of the editing interface, you can click the splitscreen icons to toggle the visibility of your file navigation, code editor, and app preview.\n\n \n\n1. Change `st.write` to `st.title`:\n\n ```python\n import streamlit as st\n\n st.title(\"Hello World\")\n ```\n\n1. In the upper-right corner, click the blue \"play_arrow **Run**\" button to make the running app reflect your changes.\n\n Your app now displays the larger title text.\n\n1. Optional: Make more edits to your app. You must interact with your app or click the blue \"play_arrow **Run**\" button to display the changes. This is different from a local environment where you can save your changes to trigger a rerun.\n\n1. To return to Snowsight, in the upper-left corner, click \"chevron_left **Streamlit Apps**.\"\n\n## Return to your app\n\nWhen you want to view or edit your app again, you can return to it through Snowsight. If you are returning to the site, you can sign in at [app.snowflake.com](https://app.snowflake.com/).\n\n1. In the left navigation, select \"**Projects**\" → \"**Streamlit**.\"\n\n1. In your list of apps, click \"**Hello World**.\"\n\n If you don't see your app, check that your role is set to \"ACCOUNTADMIN\" as described in [Optional: Create a warehouse](/get-started/installation/streamlit-in-snowflake#optional-create-a-warehouse).\n\n1. Your app will open in viewing mode. To edit your app, in the upper-right corner, click \"**Edit**.\"\n\n ![Change to editing mode in Streamlit in Snowflake](/images/get-started/SiS-5-hello-world-edit.png)\n\n## What's next?\n\nRead about our [Basic concepts](/get-started/fundamentals/main-concepts) and try out more commands in your app. Or, create more apps in Snowflake! You can reuse your warehouse and database, so you don't need to repeat those steps.\n\nFor more information about creating and managing Streamlit in Snowflake apps, check out the [Snowflake docs](https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit)." - }, - { - "url": "https://docs.streamlit.io/get-started/installation/command-line", - "content": "# Install Streamlit using command line\n\nThis page will walk you through creating an environment with `venv` and installing Streamlit with `pip`. These are our recommended tools, but if you are familiar with others you can use your favorite ones too. At the end, you'll build a simple \"Hello world\" app and run it. If you prefer to have a graphical interface to manage your Python environments, check out how to [Install Streamlit using Anaconda Distribution](/get-started/installation/anaconda-distribution).\n\n## Prerequisites\n\nAs with any programming tool, in order to install Streamlit you first need to make sure your\ncomputer is properly set up. More specifically, you’ll need:\n\n1. **Python**\n\n We support [version 3.9 to 3.13](https://www.python.org/downloads/).\n\n1. **A Python environment manager** (recommended)\n\n Environment managers create virtual environments to isolate Python package installations between\n projects.\n\n We recommend using virtual environments because installing or upgrading a Python package may\n cause unintentional effects on another package. For a detailed introduction to Python\n environments, check out\n [Python Virtual Environments: A Primer](https://realpython.com/python-virtual-environments-a-primer/).\n\n For this guide, we'll be using `venv`, which comes with Python.\n\n1. **A Python package manager**\n\n Package managers handle installing each of your Python packages, including Streamlit.\n\n For this guide, we'll be using `pip`, which comes with Python.\n\n1. **Only on MacOS: Xcode command line tools**\n\n Download Xcode command line tools using [these instructions](https://mac.install.guide/commandlinetools/4.html)\n in order to let the package manager install some of Streamlit's dependencies.\n\n1. **A code editor**\n\n Our favorite editor is [VS Code](https://code.visualstudio.com/download), which is also what we use in\n all our tutorials.\n\n## Create an environment using `venv`\n\n1. Open a terminal and navigate to your project folder.\n\n ```bash\n cd myproject\n ```\n\n2. In your terminal, type:\n\n ```bash\n python -m venv .venv\n ```\n\n3. A folder named \".venv\" will appear in your project. This directory is where your virtual environment and its dependencies are installed.\n\n## Activate your environment\n\n4. In your terminal, activate your environment with one of the following commands, depending on your operating system.\n\n ```bash\n # Windows command prompt\n .venv\\Scripts\\activate.bat\n\n # Windows PowerShell\n .venv\\Scripts\\Activate.ps1\n\n # macOS and Linux\n source .venv/bin/activate\n ```\n\n5. Once activated, you will see your environment name in parentheses before your prompt. \"(.venv)\"\n\n## Install Streamlit in your environment\n\n6. In the terminal with your environment activated, type:\n\n ```bash\n pip install streamlit\n ```\n\n7. Test that the installation worked by launching the Streamlit Hello example app:\n\n ```bash\n streamlit hello\n ```\n\n If this doesn't work, use the long-form command:\n\n ```bash\n python -m streamlit hello\n ```\n\n8. Streamlit's Hello app should appear in a new tab in your web browser!\n \n9. Close your terminal when you are done.\n\n## Create a \"Hello World\" app and run it\n\n10. Create a file named `app.py` in your project folder.\n\n```python\nimport streamlit as st\n\nst.write(\"Hello world\")\n```\n\n11. Any time you want to use your new environment, you first need to go to your project folder (where the `.venv` directory lives) and run the command to activate it:\n\n```bash\n# Windows command prompt\n.venv\\Scripts\\activate.bat\n\n# Windows PowerShell\n.venv\\Scripts\\Activate.ps1\n\n# macOS and Linux\nsource .venv/bin/activate\n```\n\n12. Once activated, you will see your environment's name in parentheses at the beginning of your terminal prompt. \"(.venv)\"\n\n13. Run your Streamlit app.\n\n```bash\nstreamlit run app.py\n```\n\nIf this doesn't work, use the long-form command:\n\n```bash\npython -m streamlit run app.py\n```\n\n14. To stop the Streamlit server, press `Ctrl+C` in the terminal.\n\n15. When you're done using this environment, return to your normal shell by typing:\n\n```bash\ndeactivate\n```\n\n## What's next?\n\nRead about our [Basic concepts](/get-started/fundamentals/main-concepts) to understand Streamlit's dataflow model." - }, - { - "url": "https://docs.streamlit.io/get-started/installation/community-cloud", - "content": "# Use Community Cloud to develop with GitHub Codespaces\n\nTo use GitHub Codespaces for Streamlit development, you need a properly configured `devcontainer.json` file to set up the environment. Fortunately, Streamlit Community Cloud is here to help! Although Community Cloud is primarily used to deploy and share apps with the rest of the world, we've built in some handy features to make it easy to use GitHub Codespaces. This guide explains how to create a Community Cloud account and use an automated workflow to get you into a GitHub codespace and live-editing a Streamlit app. All this happens right in your browser, no installation required.\n\nIf you already created a Community Cloud account and connected GitHub, jump ahead to [Create a new app from a template](/get-started/installation/community-cloud#create-a-new-app-from-a-template).\n\n## Prerequisites\n\n- You must have a GitHub account.\n\n## Sign up for Streamlit Community Cloud\n\n1. Go to share.streamlit.io.\n1. Click \"**Continue to sign-in**.\"\n1. Click \"**Continue with GitHub**.\"\n1. Enter your GitHub credentials and follow GitHub's authentication prompts.\n1. Fill in your account information, and click \"**I accept**\" at the bottom.\n\n## Add access to your public repositories\n\n1. In the upper-left corner, click on \"**Workspaces warning**.\"\n\n
\n\"Connect\n
\n\n1. From the drop down, click \"**Connect GitHub account**.\"\n1. Enter your GitHub credentials and follow GitHub's authentication prompts.\n1. Click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n## Optional: Add access to private repositories\n\n1. In the upper-left corner, click on your GitHub username.\n\n
\n\"Access\n
\n\n1. From the drop down, click \"**Settings**.\"\n1. On the left side of the dialog, select \"**Linked accounts**.\"\n1. Under \"Source control,\" click \"**Connect here arrow_forward**.\"\n1. Click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n## Create a new app from a template\n\n1. In the upper-right corner, click \"**Create app**.\"\n\n
\n\"Create\n
\n\n1. When asked \"Do you already have an app?\" click \"**Nope, create one from a template**.\"\n1. From the list of templates on the left, select \"**Blank app**.\"\n1. At the bottom, select the option to \"**Open GitHub Codespaces...**\"\n1. At the bottom, click \"**Deploy**.\"\n\n## Edit your app in GitHub Codespaces\n\n1. Wait for GitHub to set up your codespace.\n\n It can take several minutes to fully initialize your codespace. After you see the Visual Studio Code editor in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, you will see a split screen view with a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file.\n\n
\n \"Your\n
\n\n1. Go to the app's entrypoint file (`streamlit_app.py`) in the left pane, and change line 3 by adding \"Streamlit\" inside `st.title`.\n\n ```diff\n -st.title(\"🎈 My new app\")\n +st.title(\"🎈 My new Streamlit app\")\n ```\n\n Files are automatically saved in your codespace with each edit.\n\n1. A moment after typing a change, your app on the right side will display a rerun prompt. Click \"**Always rerun**.\"\n\n
\n \"Edit\n
\n\n If the rerun prompt disappears before you click it, you can hover over the overflow menu icon (more_vert) to bring it back.\n\n1. Optional: Continue to make edits and observe the changes within seconds.\n\n## Publish your changes\n\n1. In the left navigation bar, click the source control icon.\n\n
\n\"See\n
\n\n1. In the source control sidebar on the left, enter a name for your commit.\n1. Click \"**check Commit**.\"\n\n
\n\"See\n
\n\n1. In the confirmation dialog, click \"**Yes**\" to stage and commit all your changes. Your changes are committed locally in your codespace.\n1. In the source control sidebar on the left, click \"**cached 1 arrow_upward**\" to push your commit to GitHub.\n1. In the confirmation dialog, click \"**OK**\" to push commits to \"origin/main.\"\n\n Your changes are now saved to your GitHub repository. Community Cloud will immediately reflect the changes in your deployed app.\n\n1. Optional: To see your updated, published app, return to the \"**My apps**\" section of your workspace at share.streamlit.io, and click on your app.\n\n## Learn Streamlit fundamentals\n\nIf you haven't learned Streamlit's basic concepts yet, this is a great time to go to [Fundamentals](/get-started/fundamentals). Use your codespace to walk through and try basic Streamlit commands. When finished, come back here to learn how to clean up your codespace.\n\n## Stop or delete your codespace\n\nWhen you stop interacting with your codespace, GitHub will generally stop your codespace for you. However, the surest way to avoid undesired use of your capacity is to stop or delete your codespace when you are done.\n\n1. Go to github.com/codespaces. At the bottom of the page, all your codespaces are listed. Click the overflow menu icon (more_horiz) for your codespace.\n\n
\n\"Stop\n
\n\n2. If you want to return to your work later, click \"**Stop codespace**.\" Otherwise, click \"**Delete**.\"\n\n
\n \"Stop\n
\n\n3. Congratulations! You just deployed an app to Streamlit Community Cloud. 🎉 Return to your workspace at share.streamlit.io/ and [deploy another Streamlit app](/deploy/streamlit-community-cloud/deploy-your-app).\n\n
\n \"See\n
" - }, - { - "url": "https://docs.streamlit.io/get-started/installation", - "content": "# Install Streamlit\n\nThere are multiple ways to set up your development environment and install Streamlit. Read below to\nunderstand these options. Developing locally with Python installed on your own computer is the most\ncommon scenario.\n\n## Summary for experts\n\n1. Set up your Python development environment.\n2. Run:\n ```bash\n pip install streamlit\n ```\n3. Validate the installation by running our Hello app:\n ```bash\n streamlit hello\n ```\n4. Jump to our [Basic concepts](/get-started/fundamentals/main-concepts).\n\n## Installation steps for the rest of us\n\n\n\n\n\n
Option 1: I'm comfortable with the command line
\n\nInstall Streamlit on your own machine using tools like `venv` and `pip`.\n\n
\n\n\n\n
Option 2: I prefer a graphical interface
\n\nInstall Streamlit using the Anaconda Distribution graphical user interface. This is also the best\napproach if you're on Windows or don't have Python set up.\n\n
\n\n\n\n
Option 3: I'd rather use a cloud-based environment
\n\nUse Streamlit Community Cloud with GitHub Codespaces so you don't have to go through the trouble\nof installing Python and setting up an environment.\n\n
\n\n\n\n
Option 4: I need something secure, controlled, and in the cloud
\n\nUse Streamlit in Snowflake to code your apps in the cloud, right alongside your\ndata with role-based access controls.\n\n
\n\n
" - }, - { - "url": "https://docs.streamlit.io/get-started/tutorials/create-an-app", - "content": "# Create an app\n\nIf you've made it this far, chances are you've [installed Streamlit](/get-started/installation) and run through the basics in [Basic concepts](/get-started/fundamentals/main-concepts) and [Advanced concepts](/get-started/fundamentals/advanced-concepts). If not, now is a good time to take a look.\n\nThe easiest way to learn how to use Streamlit is to try things out yourself. As you read through this guide, test each method. As long as your app is running, every time you add a new element to your script and save, Streamlit's UI will ask if you'd like to rerun the app and view the changes. This allows you to work in a fast interactive loop: you write some code, save it, review the output, write some more, and so on, until you're happy with the results. The goal is to use Streamlit to create an interactive app for your data or model and along the way to use Streamlit to review, debug, perfect, and share your code.\n\nIn this guide, you're going to use Streamlit's core features to\ncreate an interactive app; exploring a public Uber dataset for pickups and\ndrop-offs in New York City. When you're finished, you'll know how to fetch\nand cache data, draw charts, plot information on a map, and use interactive\nwidgets, like a slider, to filter results.\n\n\n\nIf you'd like to skip ahead and see everything at once, the [complete script\nis available below](#lets-put-it-all-together).\n\n\n\n## Create your first app\n\nStreamlit 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!\n\n1. The first step is to create a new Python script. Let's call it\n `uber_pickups.py`.\n\n2. Open `uber_pickups.py` in your favorite IDE or text editor, then add these\n lines:\n\n ```python\n import streamlit as st\n import pandas as pd\n import numpy as np\n ```\n\n3. Every good app has a title, so let's add one:\n\n ```python\n st.title('Uber pickups in NYC')\n ```\n\n4. Now it's time to run Streamlit from the command line:\n\n ```bash\n streamlit run uber_pickups.py\n ```\n\n Running a Streamlit app is no different than any other Python script. Whenever you need to view the app, you can use this command.\n\n \n\n Did you know you can also pass a URL to `streamlit run`? This is great when combined with GitHub Gists. For example:\n\n ```bash\n streamlit run https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/streamlit_app.py\n ```\n\n \n\n5. As usual, the app should automatically open in a new tab in your\n browser.\n\n## Fetch some data\n\nNow that you have an app, the next thing you'll need to do is fetch the Uber\ndataset for pickups and drop-offs in New York City.\n\n1. Let's start by writing a function to load the data. Add this code to your\n script:\n\n ```python\n DATE_COLUMN = 'date/time'\n DATA_URL = ('https://s3-us-west-2.amazonaws.com/'\n 'streamlit-demo-data/uber-raw-data-sep14.csv.gz')\n\n def load_data(nrows):\n data = pd.read_csv(DATA_URL, nrows=nrows)\n lowercase = lambda x: str(x).lower()\n data.rename(lowercase, axis='columns', inplace=True)\n data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])\n return data\n ```\n\n You'll notice that `load_data` is a plain old function that downloads some\n data, puts it in a Pandas dataframe, and converts the date column from text\n to datetime. The function accepts a single parameter (`nrows`), which\n specifies the number of rows that you want to load into the dataframe.\n\n2. Now let's test the function and review the output. Below your function, add\n these lines:\n\n ```python\n # Create a text element and let the reader know the data is loading.\n data_load_state = st.text('Loading data...')\n # Load 10,000 rows of data into the dataframe.\n data = load_data(10000)\n # Notify the reader that the data was successfully loaded.\n data_load_state.text('Loading data...done!')\n ```\n\n You'll see a few buttons in the upper-right corner of your app asking if\n you'd like to rerun the app. Choose **Always rerun**, and you'll see your\n changes automatically each time you save.\n\nOk, that's underwhelming...\n\nIt turns out that it takes a long time to download data, and load 10,000 lines\ninto a dataframe. Converting the date column into datetime isn’t a quick job\neither. You don’t want to reload the data each time the app is updated –\nluckily Streamlit allows you to cache the data.\n\n## Effortless caching\n\n1. Try adding `@st.cache_data` before the `load_data` declaration:\n\n ```python\n @st.cache_data\n def load_data(nrows):\n ```\n\n2. Then save the script, and Streamlit will automatically rerun your app. Since\n this is the first time you’re running the script with `@st.cache_data`, you won't\n see anything change. Let’s tweak your file a little bit more so that you can\n see the power of caching.\n\n3. Replace the line `data_load_state.text('Loading data...done!')` with this:\n\n ```python\n data_load_state.text(\"Done! (using st.cache_data)\")\n ```\n\n4. Now save. See how the line you added appeared immediately? If you take a\n step back for a second, this is actually quite amazing. Something magical is\n happening behind the scenes, and it only takes one line of code to activate\n it.\n\n### How's it work?\n\nLet's take a few minutes to discuss how `@st.cache_data` actually works.\n\nWhen you mark a function with Streamlit’s cache annotation, it tells Streamlit\nthat whenever the function is called that it should check two things:\n\n1. The input parameters you used for the function call.\n2. The code inside the function.\n\nIf this is the first time Streamlit has seen both these items, with these exact\nvalues, and in this exact combination, it runs the function and stores the\nresult in a local cache. The next time the function is called, if the two\nvalues haven't changed, then Streamlit knows it can skip executing the function\naltogether. Instead, it reads the output from the local cache and passes it on\nto the caller -- like magic.\n\n\"But, wait a second,\" you’re saying to yourself, \"this sounds too good to be\ntrue. What are the limitations of all this awesomesauce?\"\n\nWell, there are a few:\n\n1. Streamlit will only check for changes within the current working directory.\n If you upgrade a Python library, Streamlit's cache will only notice this if\n that library is installed inside your working directory.\n2. If your function is not deterministic (that is, its output depends on random\n numbers), or if it pulls data from an external time-varying source (for\n example, a live stock market ticker service) the cached value will be\n none-the-wiser.\n3. Lastly, you should avoid mutating the output of a function cached with `st.cache_data` since cached\n values are stored by reference.\n\nWhile these limitations are important to keep in mind, they tend not to be an\nissue a surprising amount of the time. Those times, this cache is really\ntransformational.\n\n\n\nWhenever you have a long-running computation in your code, consider\nrefactoring it so you can use `@st.cache_data`, if possible. Please read [Caching](/develop/concepts/architecture/caching) for more details.\n\n\n\nNow that you know how caching with Streamlit works, let’s get back to the Uber\npickup data.\n\n## Inspect the raw data\n\nIt's always a good idea to take a look at the raw data you're working with\nbefore you start working with it. Let's add a subheader and a printout of the\nraw data to the app:\n\n```python\nst.subheader('Raw data')\nst.write(data)\n```\n\nIn the [Basic concepts](/get-started/fundamentals/main-concepts) guide you learned that\n[`st.write`](/develop/api-reference/write-magic/st.write) will render almost anything you pass\nto it. In this case, you're passing in a dataframe and it's rendering as an\ninteractive table.\n\n[`st.write`](/develop/api-reference/write-magic/st.write) tries to do the right thing based on\nthe data type of the input. If it isn't doing what you expect you can use a\nspecialized command like [`st.dataframe`](/develop/api-reference/data/st.dataframe)\ninstead. For a full list, see [API reference](/develop/api-reference).\n\n## Draw a histogram\n\nNow that you've had a chance to take a look at the dataset and observe what's\navailable, let's take things a step further and draw a histogram to see what\nUber's busiest hours are in New York City.\n\n1. To start, let's add a subheader just below the raw data section:\n\n ```python\n st.subheader('Number of pickups by hour')\n ```\n\n2. Use NumPy to generate a histogram that breaks down pickup times binned by\n hour:\n\n ```python\n hist_values = np.histogram(\n data[DATE_COLUMN].dt.hour, bins=24, range=(0,24))[0]\n ```\n\n3. Now, let's use Streamlit's\n [`st.bar_chart()`](/develop/api-reference/charts/st.bar_chart) method to draw this\n histogram.\n\n ```python\n st.bar_chart(hist_values)\n ```\n\n4. Save your script. This histogram should show up in your app right away.\n After a quick review, it looks like the busiest time is 17:00 (5 P.M.).\n\nTo draw this diagram we used Streamlit's native `bar_chart()` method, but it's\nimportant to know that Streamlit supports more complex charting libraries like\nAltair, Bokeh, Plotly, Matplotlib and more. For a full list, see\n[supported charting libraries](/develop/api-reference/charts).\n\n## Plot data on a map\n\nUsing a histogram with Uber's dataset helped us determine what the busiest\ntimes are for pickups, but what if we wanted to figure out where pickups were\nconcentrated throughout the city. While you could use a bar chart to show this\ndata, it wouldn't be easy to interpret unless you were intimately familiar with\nlatitudinal and longitudinal coordinates in the city. To show pickup\nconcentration, let's use Streamlit [`st.map()`](/develop/api-reference/charts/st.map)\nfunction to overlay the data on a map of New York City.\n\n1. Add a subheader for the section:\n\n ```python\n st.subheader('Map of all pickups')\n ```\n\n2. Use the `st.map()` function to plot the data:\n\n ```python\n st.map(data)\n ```\n\n3. Save your script. The map is fully interactive. Give it a try by panning or\n zooming in a bit.\n\nAfter drawing your histogram, you determined that the busiest hour for Uber\npickups was 17:00. Let's redraw the map to show the concentration of pickups\nat 17:00.\n\n1. Locate the following code snippet:\n\n ```python\n st.subheader('Map of all pickups')\n st.map(data)\n ```\n\n2. Replace it with:\n\n ```python\n hour_to_filter = 17\n filtered_data = data[data[DATE_COLUMN].dt.hour == hour_to_filter]\n st.subheader(f'Map of all pickups at {hour_to_filter}:00')\n st.map(filtered_data)\n ```\n\n3. You should see the data update instantly.\n\nTo draw this map we used the [`st.map`](/develop/api-reference/charts/st.map) function that's built into Streamlit, but\nif you'd like to visualize complex map data, we encourage you to take a look at\nthe [`st.pydeck_chart`](/develop/api-reference/charts/st.pydeck_chart).\n\n## Filter results with a slider\n\nIn the last section, when you drew the map, the time used to filter results was\nhardcoded into the script, but what if we wanted to let a reader dynamically\nfilter the data in real time? Using Streamlit's widgets you can. Let's add a\nslider to the app with the `st.slider()` method.\n\n1. Locate `hour_to_filter` and replace it with this code snippet:\n\n ```python\n hour_to_filter = st.slider('hour', 0, 23, 17) # min: 0h, max: 23h, default: 17h\n ```\n\n2. Use the slider and watch the map update in real time.\n\n## Use a button to toggle data\n\nSliders are just one way to dynamically change the composition of your app.\nLet's use the [`st.checkbox`](/develop/api-reference/widgets/st.checkbox) function to add a\ncheckbox to your app. We'll use this checkbox to show/hide the raw data\ntable at the top of your app.\n\n1. Locate these lines:\n\n ```python\n st.subheader('Raw data')\n st.write(data)\n ```\n\n2. Replace these lines with the following code:\n\n ```python\n if st.checkbox('Show raw data'):\n st.subheader('Raw data')\n st.write(data)\n ```\n\nWe're sure you've got your own ideas. When you're done with this tutorial, check out all the widgets that Streamlit exposes in our [API Reference](/develop/api-reference).\n\n## Let's put it all together\n\nThat's it, you've made it to the end. Here's the complete script for our interactive app.\n\n\n\nIf you've skipped ahead, after you've created your script, the command to run\nStreamlit is `streamlit run [app name]`.\n\n\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\n\nst.title('Uber pickups in NYC')\n\nDATE_COLUMN = 'date/time'\nDATA_URL = ('https://s3-us-west-2.amazonaws.com/'\n 'streamlit-demo-data/uber-raw-data-sep14.csv.gz')\n\n@st.cache_data\ndef load_data(nrows):\n data = pd.read_csv(DATA_URL, nrows=nrows)\n lowercase = lambda x: str(x).lower()\n data.rename(lowercase, axis='columns', inplace=True)\n data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])\n return data\n\ndata_load_state = st.text('Loading data...')\ndata = load_data(10000)\ndata_load_state.text(\"Done! (using st.cache_data)\")\n\nif st.checkbox('Show raw data'):\n st.subheader('Raw data')\n st.write(data)\n\nst.subheader('Number of pickups by hour')\nhist_values = np.histogram(data[DATE_COLUMN].dt.hour, bins=24, range=(0,24))[0]\nst.bar_chart(hist_values)\n\n# Some number in the range 0-23\nhour_to_filter = st.slider('hour', 0, 23, 17)\nfiltered_data = data[data[DATE_COLUMN].dt.hour == hour_to_filter]\n\nst.subheader('Map of all pickups at %s:00' % hour_to_filter)\nst.map(filtered_data)\n```\n\n## Share your app\n\nAfter you’ve built a Streamlit app, it's time to share it! To show it off to the world you can use **Streamlit Community Cloud** to deploy, manage, and share your app for free.\n\nIt works in 3 simple steps:\n\n1. Put your app in a public GitHub repo (and make sure it has a requirements.txt!)\n2. Sign into [share.streamlit.io](https://share.streamlit.io)\n3. Click 'Deploy an app' and then paste in your GitHub URL\n\nThat's it! 🎈 You now have a publicly deployed app that you can share with the world. Click to learn more about [how to use Streamlit Community Cloud](/deploy/streamlit-community-cloud).\n\n## Get help\n\nThat's it for getting started, now you can go and build your own apps! If you\nrun into difficulties here are a few things you can do.\n\n- Check out our [community forum](https://discuss.streamlit.io/) and post a question\n- Quick help from command line with `streamlit help`\n- Go through our [Knowledge Base](/knowledge-base) for tips, step-by-step tutorials, and articles that answer your questions about creating and deploying Streamlit apps.\n- Read more documentation! Check out:\n - [Concepts](/develop/concepts) for things like caching, theming, and adding statefulness to apps.\n - [API reference](/develop/api-reference/) for examples of every Streamlit command." - }, - { - "url": "https://docs.streamlit.io/get-started/tutorials/create-a-multipage-app", - "content": "# Create a multipage app\n\nIn [Additional features](/get-started/fundamentals/additional-features), we introduced multipage apps, including how to define pages, structure and run multipage apps, and navigate between pages in the user interface. You can read more details in our guide to [Multipage apps](/develop/concepts/multipage-apps)\n\nIn this guide, let’s put our understanding of multipage apps to use by converting the previous version of our `streamlit hello` app to a multipage app!\n\n## Motivation\n\nBefore Streamlit 1.10.0, the streamlit hello command was a large single-page app. As there was no support for multiple pages, we resorted to splitting the app's content using `st.selectbox` in the sidebar to choose what content to run. The content is comprised of three demos for plotting, mapping, and dataframes.\n\nHere's what the code and single-page app looked like:\n\n
\nhello.py (👈 Toggle to expand)\n
\n\n```python\nimport streamlit as st\n\ndef intro():\n import streamlit as st\n\n st.write(\"# Welcome to Streamlit! 👋\")\n st.sidebar.success(\"Select a demo above.\")\n\n st.markdown(\n \"\"\"\n Streamlit is an open-source app framework built specifically for\n Machine Learning and Data Science projects.\n\n **👈 Select a demo from the dropdown on the left** to see some examples\n of what Streamlit can do!\n\n ### Want to learn more?\n\n - Check out [streamlit.io](https://streamlit.io)\n - Jump into our [documentation](https://docs.streamlit.io)\n - Ask a question in our [community\n forums](https://discuss.streamlit.io)\n\n ### See more complex demos\n\n - Use a neural net to [analyze the Udacity Self-driving Car Image\n Dataset](https://github.com/streamlit/demo-self-driving)\n - Explore a [New York City rideshare dataset](https://github.com/streamlit/demo-uber-nyc-pickups)\n \"\"\"\n )\n\ndef mapping_demo():\n import streamlit as st\n import pandas as pd\n import pydeck as pdk\n\n from urllib.error import URLError\n\n st.markdown(f\"# {list(page_names_to_funcs.keys())[2]}\")\n st.write(\n \"\"\"\n This demo shows how to use\n[`st.pydeck_chart`](https://docs.streamlit.io/develop/api-reference/charts/st.pydeck_chart)\nto display geospatial data.\n\"\"\"\n )\n\n @st.cache_data\n def from_data_file(filename):\n url = (\n \"http://raw.githubusercontent.com/streamlit/\"\n \"example-data/master/hello/v1/%s\" % filename\n )\n return pd.read_json(url)\n\n try:\n ALL_LAYERS = {\n \"Bike Rentals\": pdk.Layer(\n \"HexagonLayer\",\n data=from_data_file(\"bike_rental_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n radius=200,\n elevation_scale=4,\n elevation_range=[0, 1000],\n extruded=True,\n ),\n \"Bart Stop Exits\": pdk.Layer(\n \"ScatterplotLayer\",\n data=from_data_file(\"bart_stop_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n get_color=[200, 30, 0, 160],\n get_radius=\"[exits]\",\n radius_scale=0.05,\n ),\n \"Bart Stop Names\": pdk.Layer(\n \"TextLayer\",\n data=from_data_file(\"bart_stop_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n get_text=\"name\",\n get_color=[0, 0, 0, 200],\n get_size=15,\n get_alignment_baseline=\"'bottom'\",\n ),\n \"Outbound Flow\": pdk.Layer(\n \"ArcLayer\",\n data=from_data_file(\"bart_path_stats.json\"),\n get_source_position=[\"lon\", \"lat\"],\n get_target_position=[\"lon2\", \"lat2\"],\n get_source_color=[200, 30, 0, 160],\n get_target_color=[200, 30, 0, 160],\n auto_highlight=True,\n width_scale=0.0001,\n get_width=\"outbound\",\n width_min_pixels=3,\n width_max_pixels=30,\n ),\n }\n st.sidebar.markdown(\"### Map Layers\")\n selected_layers = [\n layer\n for layer_name, layer in ALL_LAYERS.items()\n if st.sidebar.checkbox(layer_name, True)\n ]\n if selected_layers:\n st.pydeck_chart(\n pdk.Deck(\n map_style=\"mapbox://styles/mapbox/light-v9\",\n initial_view_state={\n \"latitude\": 37.76,\n \"longitude\": -122.4,\n \"zoom\": 11,\n \"pitch\": 50,\n },\n layers=selected_layers,\n )\n )\n else:\n st.error(\"Please choose at least one layer above.\")\n except URLError as e:\n st.error(\n \"\"\"\n **This demo requires internet access.**\n\n Connection error: %s\n \"\"\"\n % e.reason\n )\n\ndef plotting_demo():\n import streamlit as st\n import time\n import numpy as np\n\n st.markdown(f'# {list(page_names_to_funcs.keys())[1]}')\n st.write(\n \"\"\"\n This demo illustrates a combination of plotting and animation with\nStreamlit. We're generating a bunch of random numbers in a loop for around\n5 seconds. Enjoy!\n\"\"\"\n )\n\n progress_bar = st.sidebar.progress(0)\n status_text = st.sidebar.empty()\n last_rows = np.random.randn(1, 1)\n chart = st.line_chart(last_rows)\n\n for i in range(1, 101):\n new_rows = last_rows[-1, :] + np.random.randn(5, 1).cumsum(axis=0)\n status_text.text(\"%i%% Complete\" % i)\n chart.add_rows(new_rows)\n progress_bar.progress(i)\n last_rows = new_rows\n time.sleep(0.05)\n\n progress_bar.empty()\n\n # Streamlit widgets automatically run the script from top to bottom. Since\n # this button is not connected to any other logic, it just causes a plain\n # rerun.\n st.button(\"Re-run\")\n\n\ndef data_frame_demo():\n import streamlit as st\n import pandas as pd\n import altair as alt\n\n from urllib.error import URLError\n\n st.markdown(f\"# {list(page_names_to_funcs.keys())[3]}\")\n st.write(\n \"\"\"\n This demo shows how to use `st.write` to visualize Pandas DataFrames.\n\n(Data courtesy of the [UN Data Explorer](http://data.un.org/Explorer.aspx).)\n\"\"\"\n )\n\n @st.cache_data\n def get_UN_data():\n AWS_BUCKET_URL = \"http://streamlit-demo-data.s3-us-west-2.amazonaws.com\"\n df = pd.read_csv(AWS_BUCKET_URL + \"/agri.csv.gz\")\n return df.set_index(\"Region\")\n\n try:\n df = get_UN_data()\n countries = st.multiselect(\n \"Choose countries\", list(df.index), [\"China\", \"United States of America\"]\n )\n if not countries:\n st.error(\"Please select at least one country.\")\n else:\n data = df.loc[countries]\n data /= 1000000.0\n st.write(\"### Gross Agricultural Production ($B)\", data.sort_index())\n\n data = data.T.reset_index()\n data = pd.melt(data, id_vars=[\"index\"]).rename(\n columns={\"index\": \"year\", \"value\": \"Gross Agricultural Product ($B)\"}\n )\n chart = (\n alt.Chart(data)\n .mark_area(opacity=0.3)\n .encode(\n x=\"year:T\",\n y=alt.Y(\"Gross Agricultural Product ($B):Q\", stack=None),\n color=\"Region:N\",\n )\n )\n st.altair_chart(chart, use_container_width=True)\n except URLError as e:\n st.error(\n \"\"\"\n **This demo requires internet access.**\n\n Connection error: %s\n \"\"\"\n % e.reason\n )\n\npage_names_to_funcs = {\n \"—\": intro,\n \"Plotting Demo\": plotting_demo,\n \"Mapping Demo\": mapping_demo,\n \"DataFrame Demo\": data_frame_demo\n}\n\ndemo_name = st.sidebar.selectbox(\"Choose a demo\", page_names_to_funcs.keys())\npage_names_to_funcs[demo_name]()\n```\n\n
\n\n\n\nNotice how large the file is! Each app “page\" is written as a function, and the selectbox is used to pick which page to display. As our app grows, maintaining the code requires a lot of additional overhead. Moreover, we’re limited by the `st.selectbox` UI to choose which “page\" to run, we cannot customize individual page titles with `st.set_page_config`, and we’re unable to navigate between pages using URLs.\n\n## Convert an existing app into a multipage app\n\nNow that we've identified the limitations of a single-page app, what can we do about it? Armed with our knowledge from the previous section, we can convert the existing app to be a multipage app, of course! At a high level, we need to perform the following steps:\n\n1. Create a new `pages` folder in the same folder where the “entrypoint file\" (`hello.py`) lives\n2. Rename our entrypoint file to `Hello.py` , so that the title in the sidebar is capitalized\n3. Create three new files inside of `pages`:\n - `pages/1_📈_Plotting_Demo.py`\n - `pages/2_🌍_Mapping_Demo.py`\n - `pages/3_📊_DataFrame_Demo.py`\n4. Move the contents of the `plotting_demo`, `mapping_demo`, and `data_frame_demo` functions into their corresponding new files from Step 3\n5. Run `streamlit run Hello.py` to view your newly converted multipage app!\n\nNow, let’s walk through each step of the process and view the corresponding changes in code.\n\n## Create the entrypoint file\n\n
\nHello.py\n\n```python\nimport streamlit as st\n\nst.set_page_config(\n page_title=\"Hello\",\n page_icon=\"👋\",\n)\n\nst.write(\"# Welcome to Streamlit! 👋\")\n\nst.sidebar.success(\"Select a demo above.\")\n\nst.markdown(\n \"\"\"\n Streamlit is an open-source app framework built specifically for\n Machine Learning and Data Science projects.\n **👈 Select a demo from the sidebar** to see some examples\n of what Streamlit can do!\n ### Want to learn more?\n - Check out [streamlit.io](https://streamlit.io)\n - Jump into our [documentation](https://docs.streamlit.io)\n - Ask a question in our [community\n forums](https://discuss.streamlit.io)\n ### See more complex demos\n - Use a neural net to [analyze the Udacity Self-driving Car Image\n Dataset](https://github.com/streamlit/demo-self-driving)\n - Explore a [New York City rideshare dataset](https://github.com/streamlit/demo-uber-nyc-pickups)\n\"\"\"\n)\n```\n\n
\n
\n\nWe rename our entrypoint file to `Hello.py` , so that the title in the sidebar is capitalized and only the code for the intro page is included. Additionally, we’re able to customize the page title and favicon — as it appears in the browser tab with `st.set_page_config`. We can do so for each of our pages too!\n\n\n\nNotice how the sidebar does not contain page labels as we haven’t created any pages yet.\n\n## Create multiple pages\n\nA few things to remember here:\n\n1. We can change the ordering of pages in our MPA by adding numbers to the beginning of each Python file. If we add a 1 to the front of our file name, Streamlit will put that file first in the list.\n2. The name of each Streamlit app is determined by the file name, so to change the app name you need to change the file name!\n3. We can add some fun to our app by adding emojis to our file names that will render in our Streamlit app.\n4. Each page will have its own URL, defined by the name of the file.\n\nCheck out how we do all this below! For each new page, we create a new file inside the pages folder, and add the appropriate demo code into it.\n\n
\n\n
\n\npages/1_📈_Plotting_Demo.py\n\n```python\nimport streamlit as st\nimport time\nimport numpy as np\n\nst.set_page_config(page_title=\"Plotting Demo\", page_icon=\"📈\")\n\nst.markdown(\"# Plotting Demo\")\nst.sidebar.header(\"Plotting Demo\")\nst.write(\n \"\"\"This demo illustrates a combination of plotting and animation with\nStreamlit. We're generating a bunch of random numbers in a loop for around\n5 seconds. Enjoy!\"\"\"\n)\n\nprogress_bar = st.sidebar.progress(0)\nstatus_text = st.sidebar.empty()\nlast_rows = np.random.randn(1, 1)\nchart = st.line_chart(last_rows)\n\nfor i in range(1, 101):\n new_rows = last_rows[-1, :] + np.random.randn(5, 1).cumsum(axis=0)\n status_text.text(\"%i%% Complete\" % i)\n chart.add_rows(new_rows)\n progress_bar.progress(i)\n last_rows = new_rows\n time.sleep(0.05)\n\nprogress_bar.empty()\n\n# Streamlit widgets automatically run the script from top to bottom. Since\n# this button is not connected to any other logic, it just causes a plain\n# rerun.\nst.button(\"Re-run\")\n```\n\n
\n\n\n\n
\npages/2_🌍_Mapping_Demo.py\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport pydeck as pdk\nfrom urllib.error import URLError\n\nst.set_page_config(page_title=\"Mapping Demo\", page_icon=\"🌍\")\n\nst.markdown(\"# Mapping Demo\")\nst.sidebar.header(\"Mapping Demo\")\nst.write(\n \"\"\"This demo shows how to use\n[`st.pydeck_chart`](https://docs.streamlit.io/develop/api-reference/charts/st.pydeck_chart)\nto display geospatial data.\"\"\"\n)\n\n\n@st.cache_data\ndef from_data_file(filename):\n url = (\n \"http://raw.githubusercontent.com/streamlit/\"\n \"example-data/master/hello/v1/%s\" % filename\n )\n return pd.read_json(url)\n\n\ntry:\n ALL_LAYERS = {\n \"Bike Rentals\": pdk.Layer(\n \"HexagonLayer\",\n data=from_data_file(\"bike_rental_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n radius=200,\n elevation_scale=4,\n elevation_range=[0, 1000],\n extruded=True,\n ),\n \"Bart Stop Exits\": pdk.Layer(\n \"ScatterplotLayer\",\n data=from_data_file(\"bart_stop_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n get_color=[200, 30, 0, 160],\n get_radius=\"[exits]\",\n radius_scale=0.05,\n ),\n \"Bart Stop Names\": pdk.Layer(\n \"TextLayer\",\n data=from_data_file(\"bart_stop_stats.json\"),\n get_position=[\"lon\", \"lat\"],\n get_text=\"name\",\n get_color=[0, 0, 0, 200],\n get_size=15,\n get_alignment_baseline=\"'bottom'\",\n ),\n \"Outbound Flow\": pdk.Layer(\n \"ArcLayer\",\n data=from_data_file(\"bart_path_stats.json\"),\n get_source_position=[\"lon\", \"lat\"],\n get_target_position=[\"lon2\", \"lat2\"],\n get_source_color=[200, 30, 0, 160],\n get_target_color=[200, 30, 0, 160],\n auto_highlight=True,\n width_scale=0.0001,\n get_width=\"outbound\",\n width_min_pixels=3,\n width_max_pixels=30,\n ),\n }\n st.sidebar.markdown(\"### Map Layers\")\n selected_layers = [\n layer\n for layer_name, layer in ALL_LAYERS.items()\n if st.sidebar.checkbox(layer_name, True)\n ]\n if selected_layers:\n st.pydeck_chart(\n pdk.Deck(\n map_style=\"mapbox://styles/mapbox/light-v9\",\n initial_view_state={\n \"latitude\": 37.76,\n \"longitude\": -122.4,\n \"zoom\": 11,\n \"pitch\": 50,\n },\n layers=selected_layers,\n )\n )\n else:\n st.error(\"Please choose at least one layer above.\")\nexcept URLError as e:\n st.error(\n \"\"\"\n **This demo requires internet access.**\n Connection error: %s\n \"\"\"\n % e.reason\n )\n```\n\n
\n\n\n\n
\npages/3_📊_DataFrame_Demo.py\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport altair as alt\nfrom urllib.error import URLError\n\nst.set_page_config(page_title=\"DataFrame Demo\", page_icon=\"📊\")\n\nst.markdown(\"# DataFrame Demo\")\nst.sidebar.header(\"DataFrame Demo\")\nst.write(\n \"\"\"This demo shows how to use `st.write` to visualize Pandas DataFrames.\n(Data courtesy of the [UN Data Explorer](http://data.un.org/Explorer.aspx).)\"\"\"\n)\n\n\n@st.cache_data\ndef get_UN_data():\n AWS_BUCKET_URL = \"http://streamlit-demo-data.s3-us-west-2.amazonaws.com\"\n df = pd.read_csv(AWS_BUCKET_URL + \"/agri.csv.gz\")\n return df.set_index(\"Region\")\n\n\ntry:\n df = get_UN_data()\n countries = st.multiselect(\n \"Choose countries\", list(df.index), [\"China\", \"United States of America\"]\n )\n if not countries:\n st.error(\"Please select at least one country.\")\n else:\n data = df.loc[countries]\n data /= 1000000.0\n st.write(\"### Gross Agricultural Production ($B)\", data.sort_index())\n\n data = data.T.reset_index()\n data = pd.melt(data, id_vars=[\"index\"]).rename(\n columns={\"index\": \"year\", \"value\": \"Gross Agricultural Product ($B)\"}\n )\n chart = (\n alt.Chart(data)\n .mark_area(opacity=0.3)\n .encode(\n x=\"year:T\",\n y=alt.Y(\"Gross Agricultural Product ($B):Q\", stack=None),\n color=\"Region:N\",\n )\n )\n st.altair_chart(chart, use_container_width=True)\nexcept URLError as e:\n st.error(\n \"\"\"\n **This demo requires internet access.**\n Connection error: %s\n \"\"\"\n % e.reason\n )\n```\n\n
\n\n\n\nWith our additional pages created, we can now put it all together in the final step below.\n\n## Run the multipage app\n\nTo run your newly converted multipage app, run:\n\n```bash\nstreamlit run Hello.py\n```\n\nThat’s it! The `Hello.py` script now corresponds to the main page of your app, and other scripts that Streamlit finds in the pages folder will also be present in the new page selector that appears in the sidebar.\n\n\n\n## Next steps\n\nCongratulations! 🎉 If you've read this far, chances are you've learned to create both single-page and multipage apps. Where you go from here is entirely up to your creativity! We’re excited to see what you’ll build now that adding additional pages to your apps is easier than ever. Try adding more pages to the app we've just built as an exercise. Also, stop by the forum to show off your multipage apps with the Streamlit community! 🎈\n\nHere are a few resources to help you get started:\n\n- Deploy your app for free on Streamlit's [Community Cloud](/deploy/streamlit-community-cloud).\n- Post a question or share your multipage app on our [community forum](https://discuss.streamlit.io/c/streamlit-examples/9).\n- Check out our documentation on [Multipage apps](/develop/concepts/multipage-apps).\n- Read through [Concepts](/develop/concepts) for things like caching, theming, and adding statefulness to apps.\n- Browse our [API reference](/develop/api-reference/) for examples of every Streamlit command." - }, - { - "url": "https://docs.streamlit.io/get-started/tutorials", - "content": "# First steps building Streamlit apps\n\nIf you've just read through our [Basic concepts](/get-started/fundamentals/main-concepts) and want to get your hands on Streamlit. Check out these tutorials. Make sure you have [installed Streamlit](/get-started/installation) so you can execute the code yourself.\n\n\n uses the concepts learned in Fundamentals along with caching to walk through making your first app.\n walks through the easy steps to add pages to your app.\n" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/status", - "content": "# Status and limitations of Community Cloud\n\n## Community Cloud Status\n\nYou can view the current status of Community Cloud at [streamlitstatus.com](https://www.streamlitstatus.com/).\n\n## GitHub OAuth scope\n\nTo deploy your app, Streamlit requires access to your app's source code in GitHub and the ability to manage the public keys associated with your repositories. The default GitHub OAuth scopes are sufficient to work with apps in public GitHub repositories. However, to access your private repositories, we create a read-only [GitHub Deploy Key](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys) and then access your repo using an SSH key. When we create this key, GitHub notifies repo admins of the creation as a security measure.\n\nStreamlit requires the additional `repo` OAuth scope from GitHub to work with your private repos and manage deploy keys. We recognize that the `repo` scope provides Streamlit with extra permissions that we do not really need and which, as people who prize security, we'd rather not even be granted. This was the permission model available from GitHub when Community Cloud was created. However, we are working on adopting the new GitHub permission model to reduce uneeded permissions.\n\n### Developer permissions\n\nBecause of the OAuth limitations noted above, a developer must have administrative permissions to a repository to deploy apps from it.\n\n## Repository file structure\n\nYou can deploy multiple apps from your repository, and your entrypoint file(s) may be anywhere in your directory structure. However, Community Cloud initializes all apps from the root of your repository, even if the entrypoint file is in a subdirectory. This has the following consequences:\n\n- Community Cloud only recognizes one `.streamlit/configuration.toml` file at the root (of each branch) of your repository.\n- You must declare image, video, and audio file paths for Streamlit commands relative to the root of your repository. For example, `st.image`, `st.logo`, and the `page_icon` parameter in `st.set_page_config` expect file locations relative to your working directory (i.e. where you execute `streamlit run`).\n\n## Linux environments\n\nCommunity Cloud is built on Debian Linux.\n\n- Community Cloud uses Debian 11 (\"bullseye\"). To browse available packages that can be installed, see the [package list](https://packages.debian.org/bullseye/).\n- All file paths must use forward-slash path separators.\n\n## Python environments\n\n- You cannot mix and match Python package managers for a single app. Community Cloud configures your app's Python environment based on the first environment configuration file it finds. For more information, see [Other Python package managers](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#other-python-package-managers).\n- We recommend that you use the latest version of Streamlit to ensure full Community Cloud functionality. Be sure to take note of Streamlit's [current requirements](https://github.com/streamlit/streamlit/blob/develop/lib/setup.py) for package compatibility when planning your environment, especially `protobuf>=3.20,<6`.\n- If you pin `streamlit< 1.20.0`, you must also pin `altair<5`. Earlier versions of Streamlit did not correctly restrict Altair's version. A workaround script running on Community Cloud will forcibly install `altair<5` if a newer version is detected. This could unintentionally upgrade Altair's dependencies in violation of your environment configuration. Newer versions of Streamlit support Altair version 5.\n- Community Cloud only supports released versions of Python that are still receiving security updates. You may not use end-of-life, prerelease, or feature versions of Python. For more information, see [Status of Python versions](https://devguide.python.org/versions/).\n\n## Configuration\n\nThe following configuration options are set within Community Cloud and will override any contrary setting in your `config.toml` file:\n\n```toml\n[client]\nshowErrorDetails = false\n\n[runner]\nfastReruns = true\n\n[server]\nrunOnSave = true\nenableXsrfProtection = true\n\n[browser]\ngatherUsageStats = true\n```\n\n## IP addresses\n\nIf you need to whitelist IP addresses for a connection, Community Cloud is currently served from the following IP addresses:\n\n\n\n These IP addresses may change at any time without notice.\n\n\n\n\n
35.230.127.150
\n
35.203.151.101
\n
34.19.100.134
\n
34.83.176.217
\n
35.230.58.211
\n
35.203.187.165
\n
35.185.209.55
\n
34.127.88.74
\n
34.127.0.121
\n
35.230.78.192
\n
35.247.110.67
\n
35.197.92.111
\n
34.168.247.159
\n
35.230.56.30
\n
34.127.33.101
\n
35.227.190.87
\n
35.199.156.97
\n
34.82.135.155
\n
\n\n## Other limitations\n\n- When you print something to the Cloud logs, you may need to do a `sys.stdout.flush()` before it shows up.\n- Community Cloud hosts all apps in the United States. This is currently not configurable.\n- Community Cloud rate limits app updates from GitHub to no more than five per minute." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud", - "content": "# Welcome to Streamlit Community Cloud\n\nWith Streamlit Community Cloud, you can create, deploy, and manage your Streamlit apps — all for free. Share your apps with the world and build a customized profile page to display your work. Your Community Cloud account connects directly to your GitHub repositories (public or private). Most apps will launch in only a few minutes. Community Cloud handles all of the containerization, so deploying is easy. Bring your own code, or start from one of our popular templates. Rapidly prototype, explore, and update apps by simply changing your code in GitHub. Most changes appear immediately!\n\nWant to avoid the work of setting up a local development environment? Community Cloud can help you quickly configure a codespace to develop in the cloud. Start coding or editing a Streamlit app with just a few clicks. See [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app).\n\nGo to our [Community Cloud quickstart](/deploy/streamlit-community-cloud/get-started/quickstart) to speed-run through creating your account, deploying an example app, and editing it using GitHub Codespaces. If you haven't built your first Streamlit app yet, see [Get started with Streamlit](/get-started).\n\n\n Learn about Streamlit Community Cloud accounts and how to create one.\n A step-by-step guide on how to get your app deployed.\n Access logs, reboot apps, set favorites, and more. Jump into a GitHub codespace to edit your app in the cloud.\n Share or embed your app.\n Update your email, manage connections, or delete your account.\n" - }, - { - "url": "https://docs.streamlit.io/deploy/snowflake", - "content": "# Deploy Streamlit apps in Snowflake\n\nHost your apps alongside your data in a single, global platform. Snowflake provides industry-leading features that ensure the highest levels of security for your account, users, data, and apps. If you're looking for an enterprise hosting solution, try Snowflake!\n\n\n \n \n \n\n\nThere are three ways to host Streamlit apps in Snowflake:\n\n\n Run your Streamlit app as a native object in Snowflake. Enjoy an in-browser editor and minimal work to configure your environment. Share your app with other users in your Snowflake account through role-based access control (RBAC). This is a great way to deploy apps internally for your business. Check out Snowflake docs!\n Package your app with data and share it with other Snowflake accounts. This is a great way to share apps and their underlying data with other organizations who use Snowflake. Check out Snowflake docs!\n Deploy your app in a container that's optimized to run in Snowflake. This is the most flexible option, where you can use any library and assign a public URL to your app. Manage your allowed viewers through your Snowflake account. Check out Snowflake docs!\n\n\n\n\n Using Snowpark Container Services to deploy a Streamlit app requires a compute pool, which is not available in a trial account at this time.\n\n" - }, - { - "url": "https://docs.streamlit.io/deploy/concepts/secrets", - "content": "# Managing secrets when deploying your app\n\nIf you are connecting to data sources or external services, you will likely be handling secret information like credentials or keys. Secret information should be stored and transmitted in a secure manner. When you deploy your app, ensure that you understand your platform's features and mechanisms for handling secrets so you can follow best practice.\n\nAvoid saving secrets directly in your code and keep `.gitignore` updated to prevent accidentally committing a local secret to your repository. For helpful reminders, see [Security reminders](/develop/concepts/connections/security-reminders).\n\nIf you are using Streamlit Community Cloud, [Secrets management](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management) allows you save environment variables and store secrets outside of your code. If you are using another platform designed for Streamlit, check if they have a built-in mechanism for working with secrets. In some cases, they may even support `st.secrets` or securely uploading your `secrets.toml` file.\n\nFor information about using `st.connection` with environment variables, see [Global secrets, managing multiple apps and multiple data stores](/develop/concepts/connections/connecting-to-data#global-secrets-managing-multiple-apps-and-multiple-data-stores)." - }, - { - "url": "https://docs.streamlit.io/deploy/concepts/dependencies", - "content": "# Managing dependencies when deploying your app\n\nBefore you began developing your app, you set up and configured your development environment by installing Python and Streamlit. When you deploy your app, you need to set up and configure your deployment environment in the same way. When you deploy your app to a cloud service, your app's [Python server](/develop/concepts/architecture/architecture#python-backend-server) will be running on a remote machine. This remote machine will not have access all the files and programs on your personal computer.\n\nAll Streamlit apps have at least two dependencies: Python and Streamlit. Your app may have additional dependencies in the form of Python packages or software that must be installed to properly execute your script. If you are using a service like Streamlit Community Cloud which is designed for Streamlit apps, we'll take care of Python and Streamlit for you!\n\n## Install Python and other software\n\nIf you are using Streamlit Community Cloud, Python is already installed. You can just pick the version in the deployment dialog. If you need to install Python yourself or you have other non-Python software to install, follow your platform's instructions to install additional software. You will commonly use a package management tool to do this.\nFor example, Streamlit Community Cloud uses Advanced Package Tool (`apt`) for Debian-based Linux systems. For more information about installing non-Python depencies on Streamlit Community Cloud, see [`apt-get` dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#apt-get-dependencies).\n\n## Install Python packages\n\nOnce you have Python installed in your deployment environment, you'll need to install all the necessary Python packages, including Streamlit! With each `import` of an installed package, you add a Python dependency to your script. You need to install those dependencies in your deployment environment through a Python package manager.\n\nIf you are using Streamlit Community Cloud, you'll have the latest version of Streamlit and all of its dependencies installed by default. So, if you're making a simple app and don't need additional dependencies, you won't have to do anything at all!\n\n### `pip` and `requirements.txt`\n\nSince `pip` comes by default with Python, the most common way to configure your Python environment is with a `requirements.txt` file. Each line of a `requirements.txt` file is a package to `pip install`. You should _not_ include built-in Python libraries like `math`, `random`, or `distutils` in your `requirements.txt` file. These are a part of Python and aren't installed separately.\n\n\n\nSince dependencies may rely on a specific version of Python, always be aware of the Python version used in your development environment, and select the same version for your deployment environment.\n\n\n\nIf you have a script like the following, you would only need to install Streamlit. No extra dependencies would be needed since `pandas` and `numpy` are installed as direct dependencies of `streamlit`. Similarly, `math` and `random` are built into Python.\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport math\nimport random\n\nst.write('Hi!')\n```\n\nHowever, it's a best practice accurately record packages you use, so the recommended `requirements.txt` file would be:\n\n```none\nstreamlit\npandas\nnumpy\n```\n\nIf you needed to specify certain versions, another valid example would be:\n\n```none\nstreamlit==1.24.1\npandas>2.0\nnumpy<=1.25.1\n```\n\nA `requirements.txt` file is commonly saved in the root of your repository or file directory. If you are using Streamlit Community Cloud, see [Add Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) for more information. Otherwise, check your platform's documentation." - }, - { - "url": "https://docs.streamlit.io/deploy/concepts", - "content": "# Deployment concepts\n\nLearn the fundamental concepts of app deployment. There are three main processes involved in deploying apps.\n\n- Install Python, Streamlit, and other dependencies in your deployment environment.\n- Securely handle your secrets and private information.\n- Remote start your app (`streamlit run`).\n\nIf you're using Streamlit Community Cloud, we'll do most of the work for you!\n\n\n Understand the basics of configuring your deployment environment.\n Understand the basics of secret management.\n" - }, - { - "url": "https://docs.streamlit.io/deploy/tutorials/kubernetes", - "content": "# Deploy Streamlit using Kubernetes\n\n## Introduction\n\nSo you have an amazing app and you want to start sharing it with other people, what do you do? You have a few options. First, where do you want to run your Streamlit app, and how do you want to access it?\n\n- **On your corporate network** - Most corporate networks are closed to the outside world. You typically use a VPN to log onto your corporate network and access resources there. You could run your Streamlit app on a server in your corporate network for security reasons, to ensure that only folks internal to your company can access it.\n- **On the cloud** - If you'd like to access your Streamlit app from outside of a corporate network, or share your app with folks outside of your home network or laptop, you might choose this option. In this case, it'll depend on your hosting provider. We have [community-submitted guides](/knowledge-base/deploy/deploy-streamlit-heroku-aws-google-cloud) from Heroku, AWS, and other providers.\n\nWherever you decide to deploy your app, you will first need to containerize it. This guide walks you through using Kubernetes to deploy your app. If you prefer Docker see [Deploy Streamlit using Docker](/deploy/tutorials/docker).\n\n## Prerequisites\n\n1. [Install Docker Engine](#install-docker-engine)\n2. [Install the gcloud CLI](#install-the-gcloud-cli)\n\n### Install Docker Engine\n\nIf you haven't already done so, install [Docker](https://docs.docker.com/engine/install/#server) on your server. Docker provides `.deb` and `.rpm` packages from many Linux distributions, including:\n\n- [Debian](https://docs.docker.com/engine/install/debian/)\n- [Ubuntu](https://docs.docker.com/engine/install/ubuntu/)\n\nVerify that Docker Engine is installed correctly by running the `hello-world` Docker image:\n\n```bash\nsudo docker run hello-world\n```\n\n\n\nFollow Docker's official [post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall/) to run Docker as a non-root user, so that you don't have to preface the `docker` command with `sudo`.\n\n\n\n### Install the gcloud CLI\n\nIn this guide, we will orchestrate Docker containers with Kubernetes and host docker images on the Google Container Registry (GCR). As GCR is a Google-supported Docker registry, we need to register [`gcloud`](https://cloud.google.com/sdk/gcloud/reference) as the Docker credential helper.\n\nFollow the official documentation to [Install the gcloud CLI](https://cloud.google.com/sdk/docs/install) and initialize it.\n\n## Create a Docker container\n\nWe need to create a docker container which contains all the dependencies and the application code. Below you can see the entrypoint, i.e. the command run when the container starts, and the Dockerfile definition.\n\n### Create an entrypoint script\n\nCreate a `run.sh` script containing the following:\n\n```bash\n#!/bin/bash\n\nAPP_PID=\nstopRunningProcess() {\n # Based on https://linuxconfig.org/how-to-propagate-a-signal-to-child-processes-from-a-bash-script\n if test ! \"${APP_PID}\" = '' && ps -p ${APP_PID} > /dev/null ; then\n > /proc/1/fd/1 echo \"Stopping ${COMMAND_PATH} which is running with process ID ${APP_PID}\"\n\n kill -TERM ${APP_PID}\n > /proc/1/fd/1 echo \"Waiting for ${COMMAND_PATH} to process SIGTERM signal\"\n\n wait ${APP_PID}\n > /proc/1/fd/1 echo \"All processes have stopped running\"\n else\n > /proc/1/fd/1 echo \"${COMMAND_PATH} was not started when the signal was sent or it has already been stopped\"\n fi\n}\n\ntrap stopRunningProcess EXIT TERM\n\nsource ${VIRTUAL_ENV}/bin/activate\n\nstreamlit run ${HOME}/app/streamlit_app.py &\nAPP_ID=${!}\n\nwait ${APP_ID}\n```\n\n### Create a Dockerfile\n\nDocker builds images by reading the instructions from a `Dockerfile`. A `Dockerfile` is a text document that contains all the commands a user could call on the command line to assemble an image. Learn more in the [Dockerfile reference](https://docs.docker.com/engine/reference/builder/). The [docker build](https://docs.docker.com/engine/reference/commandline/build/) command builds an image from a `Dockerfile`. The [docker run](https://docs.docker.com/engine/reference/commandline/run/) command first creates a container over the specified image, and then starts it using the specified command.\n\nHere's an example `Dockerfile` that you can add to the root of your directory.\n\n```docker\nFROM python:3.9-slim\n\nRUN groupadd --gid 1000 appuser \\\n && useradd --uid 1000 --gid 1000 -ms /bin/bash appuser\n\nRUN pip3 install --no-cache-dir --upgrade \\\n pip \\\n virtualenv\n\nRUN apt-get update && apt-get install -y \\\n build-essential \\\n software-properties-common \\\n git\n\nUSER appuser\nWORKDIR /home/appuser\n\nRUN git clone https://github.com/streamlit/streamlit-example.git app\n\nENV VIRTUAL_ENV=/home/appuser/venv\nRUN virtualenv ${VIRTUAL_ENV}\nRUN . ${VIRTUAL_ENV}/bin/activate && pip install -r app/requirements.txt\n\nEXPOSE 8501\n\nCOPY run.sh /home/appuser\nENTRYPOINT [\"./run.sh\"]\n```\n\n\n\nAs mentioned in [Development flow](/get-started/fundamentals/main-concepts#development-flow), for Streamlit version 1.10.0 and higher, Streamlit apps cannot be run from the root directory of Linux distributions. Your main script should live in a directory other than the root directory. If you try to run a Streamlit app from the root directory, Streamlit will throw a `FileNotFoundError: [Errno 2] No such file or directory` error. For more information, see GitHub issue [#5239](https://github.com/streamlit/streamlit/issues/5239).\n\nIf you are using Streamlit version 1.10.0 or higher, you must set the `WORKDIR` to a directory other than the root directory. For example, you can set the `WORKDIR` to `/home/appuser` as shown in the example `Dockerfile` above.\n\n\n### Build a Docker image\n\nPut the above files (`run.sh` and `Dockerfile`) in the same folder and build the docker image:\n\n```docker\ndocker build --platform linux/amd64 -t gcr.io/$GCP_PROJECT_ID/k8s-streamlit:test .\n```\n\n\n\nReplace `$GCP_PROJECT_ID` in the above command with the name of your Google Cloud project.\n\n\n\n### Upload the Docker image to a container registry\n\nThe next step is to upload the Docker image to a container registry. In this example, we will use the [Google Container Registry (GCR)](https://cloud.google.com/container-registry). Start by enabling the Container Registry API. Sign in to Google Cloud and navigate to your project’s **Container Registry** and click **Enable**.\n\nWe can now build the Docker image from the previous step and push it to our project’s GCR. Be sure to replace `$GCP_PROJECT_ID` in the docker push command with the name of your project:\n\n```bash\ngcloud auth configure-docker\ndocker push gcr.io/$GCP_PROJECT_ID/k8s-streamlit:test\n```\n\n## Create a Kubernetes deployment\n\nFor this step you will need a:\n\n- Running Kubernetes service\n- Custom domain for which you can generate a TLS certificate\n- DNS service where you can configure your custom domain to point to the application IP\n\nAs the image was uploaded to the container registry in the previous step, we can run it in Kubernetes using the below configurations.\n\n### Install and run Kubernetes\n\nMake sure your [Kubernetes client](https://kubernetes.io/docs/tasks/tools/#kubectl), `kubectl`, is installed and running on your machine.\n\n### Configure a Google OAuth Client and oauth2-proxy\n\nFor configuring the Google OAuth Client, please see [Google Auth Provider](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider#google-auth-provider). Configure oauth2-proxy to use the desired [OAuth Provider Configuration](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider) and update the oath2-proxy config in the config map.\n\nThe below configuration contains a ouath2-proxy sidecar container which handles the authentication with Google. You can learn more from the [oauth2-proxy repository](https://github.com/oauth2-proxy/oauth2-proxy).\n\n### Create a Kubernetes configuration file\n\nCreate a [YAML](https://yaml.org/) [configuration file](https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#organizing-resource-configurations) named `k8s-streamlit.yaml`:\n\n```yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n name: streamlit-configmap\ndata:\n oauth2-proxy.cfg: |-\n http_address = \"0.0.0.0:4180\"\n upstreams = [\"http://127.0.0.1:8501/\"]\n email_domains = [\"*\"]\n client_id = \"\"\n client_secret = \"\"\n cookie_secret = \"<16, 24, or 32 bytes>\"\n redirect_url = \n\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: streamlit-deployment\n labels:\n app: streamlit\nspec:\n replicas: 1\n selector:\n matchLabels:\n app: streamlit\n template:\n metadata:\n labels:\n app: streamlit\n spec:\n containers:\n - name: oauth2-proxy\n image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.0\n args: [\"--config\", \"/etc/oauth2-proxy/oauth2-proxy.cfg\"]\n ports:\n - containerPort: 4180\n livenessProbe:\n httpGet:\n path: /ping\n port: 4180\n scheme: HTTP\n readinessProbe:\n httpGet:\n path: /ping\n port: 4180\n scheme: HTTP\n volumeMounts:\n - mountPath: \"/etc/oauth2-proxy\"\n name: oauth2-config\n - name: streamlit\n image: gcr.io/GCP_PROJECT_ID/k8s-streamlit:test\n imagePullPolicy: Always\n ports:\n - containerPort: 8501\n livenessProbe:\n httpGet:\n path: /_stcore/health\n port: 8501\n scheme: HTTP\n timeoutSeconds: 1\n readinessProbe:\n httpGet:\n path: /_stcore/health\n port: 8501\n scheme: HTTP\n timeoutSeconds: 1\n resources:\n limits:\n cpu: 1\n memory: 2Gi\n requests:\n cpu: 100m\n memory: 745Mi\n volumes:\n - name: oauth2-config\n configMap:\n name: streamlit-configmap\n\n---\napiVersion: v1\nkind: Service\nmetadata:\n name: streamlit-service\nspec:\n type: LoadBalancer\n selector:\n app: streamlit\n ports:\n - name: streamlit-port\n protocol: TCP\n port: 80\n targetPort: 4180\n```\n\n\n\nWhile the above configurations can be copied verbatim, you will have to configure the `oauth2-proxy` yourself and use the correct `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_ID`, `GCP_PROJECT_ID`, and `REDIRECT_URL`.\n\n\n\nNow create the configuration from the file in Kubernetes with the [`kubectl create`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#create) command:\n\n```bash\nkubctl create -f k8s-streamlit.yaml\n```\n\n### Set up TLS support\n\nSince you are using the Google authentication, you will need to set up TLS support. Find out how in [TLS Configuration](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/tls).\n\n### Verify the deployment\n\nOnce the deployment and the service are created, we need to wait a couple of minutes for the public IP address to become available. We can check when that is ready by running:\n\n```bash\nkubectl get service streamlit-service -o jsonpath='{.status.loadBalancer.ingress[0].ip}'\n```\n\nAfter the public IP is assigned, you will need to configure in your DNS service an `A record` pointing to the above IP address." - }, - { - "url": "https://docs.streamlit.io/deploy/tutorials/docker", - "content": "# Deploy Streamlit using Docker\n\n## Introduction\n\nSo you have an amazing app and you want to start sharing it with other people, what do you do? You have a few options. First, where do you want to run your Streamlit app, and how do you want to access it?\n\n- **On your corporate network** - Most corporate networks are closed to the outside world. You typically use a VPN to log onto your corporate network and access resources there. You could run your Streamlit app on a server in your corporate network for security reasons, to ensure that only folks internal to your company can access it.\n- **On the cloud** - If you'd like to access your Streamlit app from outside of a corporate network, or share your app with folks outside of your home network or laptop, you might choose this option. In this case, it'll depend on your hosting provider. We have [community-submitted guides](/knowledge-base/deploy/deploy-streamlit-heroku-aws-google-cloud) from Heroku, AWS, and other providers.\n\nWherever you decide to deploy your app, you will first need to containerize it. This guide walks you through using Docker to deploy your app. If you prefer Kubernetes see [Deploy Streamlit using Kubernetes](/deploy/tutorials/kubernetes).\n\n## Prerequisites\n\n1. [Install Docker Engine](#install-docker-engine)\n2. [Check network port accessibility](#check-network-port-accessibility)\n\n### Install Docker Engine\n\nIf you haven't already done so, install [Docker](https://docs.docker.com/engine/install/#server) on your server. Docker provides `.deb` and `.rpm` packages from many Linux distributions, including:\n\n- [Debian](https://docs.docker.com/engine/install/debian/)\n- [Ubuntu](https://docs.docker.com/engine/install/ubuntu/)\n\nVerify that Docker Engine is installed correctly by running the `hello-world` Docker image:\n\n```bash\nsudo docker run hello-world\n```\n\n\n\nFollow Docker's official [post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall/) to run Docker as a non-root user, so that you don't have to preface the `docker` command with `sudo`.\n\n\n\n### Check network port accessibility\n\nAs you and your users are behind your corporate VPN, you need to make sure all of you can access a certain network port. Let's say port `8501`, as it is the default port used by Streamlit. Contact your IT team and request access to port `8501` for you and your users.\n\n## Create a Dockerfile\n\nDocker builds images by reading the instructions from a `Dockerfile`. A `Dockerfile` is a text document that contains all the commands a user could call on the command line to assemble an image. Learn more in the [Dockerfile reference](https://docs.docker.com/engine/reference/builder/). The [docker build](https://docs.docker.com/engine/reference/commandline/build/) command builds an image from a `Dockerfile`. The [docker run](https://docs.docker.com/engine/reference/commandline/run/) command first creates a container over the specified image, and then starts it using the specified command.\n\nHere's an example `Dockerfile` that you can add to the root of your directory. i.e. in `/app/`\n\n```docker\n# app/Dockerfile\n\nFROM python:3.9-slim\n\nWORKDIR /app\n\nRUN apt-get update && apt-get install -y \\\n build-essential \\\n curl \\\n software-properties-common \\\n git \\\n && rm -rf /var/lib/apt/lists/*\n\nRUN git clone https://github.com/streamlit/streamlit-example.git .\n\nRUN pip3 install -r requirements.txt\n\nEXPOSE 8501\n\nHEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health\n\nENTRYPOINT [\"streamlit\", \"run\", \"streamlit_app.py\", \"--server.port=8501\", \"--server.address=0.0.0.0\"]\n```\n\n### Dockerfile walkthrough\n\nLet’s walk through each line of the Dockerfile :\n\n1. A `Dockerfile` must start with a [`FROM`](https://docs.docker.com/engine/reference/builder/#from) instruction. It sets the [Base Image](https://docs.docker.com/glossary/#base-image) (think OS) for the container:\n\n ```docker\n FROM python:3.9-slim\n ```\n\n Docker has a number of official Docker base images based on various Linux distributions. They also have base images that come with language-specific modules such as [Python](https://hub.docker.com/_/python). The `python` images come in many flavors, each designed for a specific use case. Here, we use the `python:3.9-slim` image which is a lightweight image that comes with the latest version of Python 3.9.\n\n \n\n You can also use your own base image, provided the image you use contains a [supported version of Python](/knowledge-base/using-streamlit/sanity-checks#check-0-are-you-using-a-streamlit-supported-version-of-python) for Streamlit. There is no one-size-fits-all approach to using any specific base image, nor is there an official Streamlit-specific base image.\n\n \n\n2. The `WORKDIR` instruction sets the working directory for any `RUN`, `CMD`, `ENTRYPOINT`, `COPY` and `ADD` instructions that follow it in the `Dockerfile` . Let’s set it to `app/` :\n\n ```docker\n WORKDIR /app\n ```\n\n \n\n As mentioned in [Development flow](/get-started/fundamentals/main-concepts#development-flow), for Streamlit version 1.10.0 and higher, Streamlit apps cannot be run from the root directory of Linux distributions. Your main script should live in a directory other than the root directory. If you try to run a Streamlit app from the root directory, Streamlit will throw a `FileNotFoundError: [Errno 2] No such file or directory` error. For more information, see GitHub issue [#5239](https://github.com/streamlit/streamlit/issues/5239).\n\n If you are using Streamlit version 1.10.0 or higher, you must set the `WORKDIR` to a directory other than the root directory. For example, you can set the `WORKDIR` to `/app` as shown in the example `Dockerfile` above.\n \n\n3. Install `git` so that we can clone the app code from a remote repo:\n\n ```docker\n RUN apt-get update && apt-get install -y \\\n build-essential \\\n curl \\\n software-properties-common \\\n git \\\n && rm -rf /var/lib/apt/lists/*\n ```\n\n4. Clone your code that lives in a remote repo to `WORKDIR`:\n\n a. If your code is in a public repo:\n\n ```docker\n RUN git clone https://github.com/streamlit/streamlit-example.git .\n ```\n\n Once cloned, the directory of `WORKDIR` will look like the following:\n\n ```bash\n app/\n - requirements.txt\n - streamlit_app.py\n ```\n\n where `requirements.txt` file contains all your [Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies). E.g\n\n ```\n altair\n pandas\n streamlit\n ```\n\n and `streamlit_app.py` is your main script. E.g.\n\n ```python\n from collections import namedtuple\n import altair as alt\n import math\n import pandas as pd\n import streamlit as st\n\n \"\"\"\n # Welcome to Streamlit!\n\n Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:\n\n If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community\n forums](https://discuss.streamlit.io).\n\n In the meantime, below is an example of what you can do with just a few lines of code:\n \"\"\"\n\n with st.echo(code_location='below'):\n total_points = st.slider(\"Number of points in spiral\", 1, 5000, 2000)\n num_turns = st.slider(\"Number of turns in spiral\", 1, 100, 9)\n\n Point = namedtuple('Point', 'x y')\n data = []\n\n points_per_turn = total_points / num_turns\n\n for curr_point_num in range(total_points):\n curr_turn, i = divmod(curr_point_num, points_per_turn)\n angle = (curr_turn + 1) * 2 * math.pi * i / points_per_turn\n radius = curr_point_num / total_points\n x = radius * math.cos(angle)\n y = radius * math.sin(angle)\n data.append(Point(x, y))\n\n st.altair_chart(alt.Chart(pd.DataFrame(data), height=500, width=500)\n .mark_circle(color='#0068c9', opacity=0.5)\n .encode(x='x:Q', y='y:Q'))\n ```\n\n b. If your code is in a private repo, please read [Using SSH to access private data in builds](https://docs.docker.com/develop/develop-images/build_enhancements/#using-ssh-to-access-private-data-in-builds) and modify the Dockerfile accordingly -- to install an SSH client, download the public key for [github.com](https://github.com), and clone your private repo. If you use an alternative VCS such as GitLab or Bitbucket, please consult the documentation for that VCS on how to copy your code to the `WORKDIR` of the Dockerfile.\n\n c. If your code lives in the same directory as the Dockerfile, copy all your app files from your server into the container, including `streamlit_app.py`, `requirements.txt`, etc, by replacing the `git clone` line with:\n\n ```docker\n COPY . .\n ```\n\n More generally, the idea is copy your app code from wherever it may live on your server into the container. If the code is not in the same directory as the Dockerfile, modify the above command to include the path to the code.\n\n5. Install your app’s [Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) from the cloned `requirements.txt` in the container:\n\n ```docker\n RUN pip3 install -r requirements.txt\n ```\n\n6. The [`EXPOSE`](https://docs.docker.com/engine/reference/builder/#expose) instruction informs Docker that the container listens on the specified network ports at runtime. Your container needs to listen to Streamlit’s (default) port 8501:\n\n ```docker\n EXPOSE 8501\n ```\n\n7. The [`HEALTHCHECK`](https://docs.docker.com/engine/reference/builder/#expose) instruction tells Docker how to test a container to check that it is still working. Your container needs to listen to Streamlit’s (default) port 8501:\n\n ```docker\n HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health\n ```\n\n8. An [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#entrypoint) allows you to configure a container that will run as an executable. Here, it also contains the entire `streamlit run` command for your app, so you don’t have to call it from the command line:\n\n ```docker\n ENTRYPOINT [\"streamlit\", \"run\", \"streamlit_app.py\", \"--server.port=8501\", \"--server.address=0.0.0.0\"]\n ```\n\n## Build a Docker image\n\nThe [`docker build`](https://docs.docker.com/engine/reference/commandline/build/) command builds an image from a `Dockerfile` . Run the following command from the `app/` directory on your server to build the image:\n\n```docker\ndocker build -t streamlit .\n```\n\nThe `-t` flag is used to tag the image. Here, we have tagged the image `streamlit`. If you run:\n\n```docker\ndocker images\n```\n\nYou should see a `streamlit` image under the REPOSITORY column. For example:\n\n```\nREPOSITORY TAG IMAGE ID CREATED SIZE\nstreamlit latest 70b0759a094d About a minute ago 1.02GB\n```\n\n## Run the Docker container\n\nNow that you have built the image, you can run the container by executing:\n\n```docker\ndocker run -p 8501:8501 streamlit\n```\n\nThe `-p` flag publishes the container’s port 8501 to your server’s 8501 port.\n\nIf all went well, you should see an output similar to the following:\n\n```\ndocker run -p 8501:8501 streamlit\n\n You can now view your Streamlit app in your browser.\n\n URL: http://0.0.0.0:8501\n```\n\nTo view your app, users can browse to `http://0.0.0.0:8501` or `http://localhost:8501`\n\n\n\nBased on your server's network configuration, you could map to port 80/443 so that users can view your app using the server IP or hostname. For example: `http://your-server-ip:80` or `http://your-hostname:443`.\n\n" - }, - { - "url": "https://docs.streamlit.io/deploy/tutorials", - "content": "# Deployment tutorials\n\nThis sections contains step-by-step guides on how to deploy Streamlit apps to various cloud platforms and services. We have deployment guides for:\n\n\n\n\n\"screenshot\"\n\n
Streamlit Community Cloud
\n\n
\n\n\n\n\"screenshot\"\n\n
Docker
\n\n
\n\n\n\n\"screenshot\"\n\n
Kubernetes
\n\n
\n
\n\nWhile we work on official Streamlit deployment guides for other hosting providers, here are some user-submitted tutorials for different cloud services:\n\n- [How to deploy Streamlit apps to **Google App Engine**](https://dev.to/whitphx/how-to-deploy-streamlit-apps-to-google-app-engine-407o), by [Yuichiro Tachibana (Tsuchiya)](https://discuss.streamlit.io/u/whitphx/summary).\n- [Host Streamlit on **Heroku**](https://towardsdatascience.com/quickly-build-and-deploy-an-application-with-streamlit-988ca08c7e83), by Maarten Grootendorst.\n- [Deploy Streamlit on **Ploomber Cloud**](https://docs.cloud.ploomber.io/en/latest/apps/streamlit.html), by Ido Michael.\n- [Host Streamlit on **21YunBox**](https://www.21yunbox.com/docs/#/deploy-streamlit), by Toby Lei.\n- [Deploy a Streamlit App on **Koyeb**](https://www.koyeb.com/docs/deploy/streamlit), by Justin Ellingwood.\n- [Community-supported deployment wiki](https://discuss.streamlit.io/t/streamlit-deployment-guide-wiki/5099)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/upgrade-python", - "content": "# Upgrade your app's Python version on Community Cloud\n\nDependencies within Python can be upgraded in place by simply changing your environment configuration file (typically `requirements.txt`). However, Python itself can't be changed after deployment.\n\nWhen you deploy an app, you can select the version of Python through the \"**Advanced settings**\" dialog. After you have deployed an app, you must delete it and redeploy it to change the version of Python it uses.\n\n1. Take note of your app's settings:\n\n - Current, custom subdomain.\n - GitHub coordinates (repository, branch, and entrypoint file path).\n - Secrets.\n\n When you delete an app, its custom subdomain is immediately available for reuse.\n\n1. [Delete your app](/deploy/streamlit-community-cloud/manage-your-app/delete-your-app).\n1. [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app).\n 1. On the deployment page, select your app's GitHub coordinates.\n 1. Set your custom domain to match your deleted instance.\n 1. Click \"**Advanced settings**.\"\n 1. Choose your desired version of Python.\n 1. Optional: If your app had secrets, re-enter them.\n 1. Click \"**Save**.\"\n 1. Click \"**Deploy**.\"\n\nIn a few minutes, Community Cloud will redirect you to your redployed app." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/edit-your-app", - "content": "# Edit your app\n\nYou can edit your app from any development environment of your choice. Streamlit Community Cloud will monitor your repository and automatically copy any file changes you commit. You will immediately see commits reflected in your deployed app for most changes (such as edits to your app's Python files).\n\nCommunity Cloud also makes it easy to skip the work of setting up a development environment. With a few simple clicks, you can configure a development environment using GitHub Codespaces.\n\n## Edit your app with GitHub Codespaces\n\nSpin up a cloud-based development environment for your deployed app in minutes. You can run your app within your codespace to enjoy experimenting in a safe, sandboxed environment. When you are done editing your code, you can commit your changes to your repo or just leave them in your codespace to return to later.\n\n### Create a codespace for your deployed app\n\n1. From your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click \"**Edit with Codespaces**.\"\n\n ![Edit your app with GitHub Codespaces](/images/streamlit-community-cloud/workspace-app-edit.png)\n\n Community Cloud will add a `.devcontainer/devcontainer.json` file to your repository. If you already have a file of the same name in your repository, it will not be changed. If you want your repository to receive the instance created by Community Cloud, delete or rename your existing devcontainer configuration.\n\n1. Wait for GitHub to set up your codespace.\n\n It can take several minutes to fully initialize your codespace. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file.\n\n ![Your new GitHub Codespace](/images/streamlit-community-cloud/deploy-template-blank-codespace.png)\n\n1. Optional: For more room to work, open the app preview in another tab.\n\n If you have multiple monitors and want a little more room to work, open your app preview in another tab instead of using the Simple Browser within Visual Studio Code. Just copy the URL from the Simple Browser into another tab, and then close the Simple Browser. Now you have more room to edit your code. The remaining steps on this page will continue to display the split-screen view in Visual Studio Code.\n\n1. Make a change to your app.\n\n When you make changes to your app, the file is automatically saved within your codespace. Your edits do not affect your repository or deployed app until you commit those changes, which is explained in a later step. The app preview shown on the right is local to your codespace.\n\n1. In order to see updates automatically reflected on the right, click \"**Always rerun**\" when prompted after your first edit.\n\n ![Select \"Always rerun\" to automatically see edits in your running app](/images/streamlit-community-cloud/deploy-template-blank-codespace-edit.png)\n\n Alternatively, you can click \"**Rerun**\" to avoid unnecessary reruns while writing code. Because your code is continually saved, automatically rerunning the app will raises errors when you pause partway through a line of code. Regardless of which you choose, you can change the setting through the app chrome. Just click the overflow icon (more_vert) in the upper-right corner of your preview app, click \"**Settings**,\" and then toggle \"**Run on save**.\"\n\n1. Continue to edit your app. Your codespace will continue to automatically save your files as you work with them, and the preview will continue to update as the app reruns.\n\n### Optional: Publish your changes\n\nAfter making edits to your app, you can choose to commit your edits to your repository to update your deployed app instantly. If you just want to keep your edits in your codespace to return to later, skip to [Stop or delete your codespace](#stop-or-delete-your-codespace).\n\n1. In the left navigation bar, click the source control icon.\n\n ![Click on the source control icon](/images/streamlit-community-cloud/deploy-template-blank-codespace-edit-source-control.png)\n\n1. In the source control sidebar on the left, enter a name for your commit.\n1. Click \"**check Commit**.\"\n\n ![See your deployed Streamlit app](/images/streamlit-community-cloud/deploy-template-blank-codespace-edit-commit.png)\n\n1. To stage and commit all your changes, in the confirmation dialog, click \"**Yes**.\" Your changes are committed locally in your codespace.\n1. To push your commit to GitHub, in the source control sidebar on the left, click \"**cached 1 arrow_upward**.\"\n1. To push commits to \"origin/main,\" in the confirmation dialog, click \"**OK**.\"\n\n Your changes are now saved to your GitHub repository. Community Cloud will immediately reflect the changes in your deployed app.\n\n1. Optional: To see your updated, published app, return to the \"**My apps**\" section of your workspace at share.streamlit.io, and click on your app.\n\n### Stop or delete your codespace\n\nWhen you stop interacting with your codespace, GitHub will generally stop your codespace for you. However, the surest way to avoid undesired use of your capacity is to stop or delete your codespace when you are done.\n\n1. Go to github.com/codespaces. At the bottom of the page, all your codespaces are listed. Click the overflow menu icon (more_horiz) for your codespace.\n\n ![Stop or delete your GitHub Codespace](/images/streamlit-community-cloud/deploy-hello-codespace-manage.png)\n\n2. Click \"**Stop codespace**\" if you'd like to return to your work later. Otherwise, click \"**Delete**.\"\n\n
\n \"Stop\n
\n\n3. Congratulations! You just deployed an app to Community Cloud. 🎉 Head back to your workspace at share.streamlit.io/ and [deploy another Streamlit app](/deploy/streamlit-community-cloud/deploy-your-app).\n\n ![See your deployed Streamlit app](/images/streamlit-community-cloud/deploy-template-blank-edited.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app", - "content": "# Reboot your app\n\nIf you need to clear your app's memory or force a fresh build after modifying a file that Streamlit Community Cloud doesn't monitor, you may need to reboot your app. This will interrupt any user who may currently be using your app and may take a few minutes for your app to redeploy. Anyone visiting your app will see \"Your app is in the oven\" during a reboot.\n\nRebooting your app on Community Cloud is easy! You can reboot your app:\n\n- [From your workspace](#reboot-your-app-from-your-workspace).\n- [From your Cloud logs](#reboot-your-app-from-your-cloud-logs).\n\n### Reboot your app from your workspace\n\n1. From your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click \"**Reboot**.\"\n\n ![Reboot your app from your workspace](/images/streamlit-community-cloud/workspace-app-reboot.png)\n\n2. A confirmation will display. Click \"**Reboot**.\"\n\n
\n\"Confirm\n
\n\n### Reboot your app from your Cloud logs\n\n1. From your app at `.streamlit.app`, click \"**Manage app**\" in the lower-right corner.\n\n ![Access Streamlit Community Cloud logs from your app](/images/streamlit-community-cloud/cloud-logs-open.png)\n\n2. Click the overflow menu icon (more_vert) and click \"**Reboot app**.\"\n\n ![Reboot your app from your Cloud logs](/images/streamlit-community-cloud/cloud-logs-menu-reboot.png)\n\n3. A confirmation will display. Click \"**Reboot**.\"\n\n
\n\"Confirm\n
" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/app-settings", - "content": "# App settings\n\nThis page is about your app settings on Streamlit Community Cloud. From your app settings you can [view or change your app's URL](/deploy/streamlit-community-cloud/manage-your-app/app-settings#view-or-change-your-apps-url), manage [public or private access to your app](/deploy/streamlit-community-cloud/share-your-app), and update your saved [secrets for your apps](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management).\n\nIf you access \"**Settings**\" from your [app chrome](/develop/concepts/architecture/app-chrome) in the upper-right corner of your running app, you can access features to control the appearance of your app while it's running.\n\n## Access your app settings\n\nYou can get to your app's settings:\n\n- [From your workspace](#access-app-settings-from-your-workspace).\n- [From your Cloud logs](#access-app-settings-from-your-cloud-logs).\n\n### Access app settings from your workspace\n\nFrom your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click \"**Settings**.\"\n\n![Access app settings from your workspace](/images/streamlit-community-cloud/workspace-app-settings.png)\n\n### Access app settings from your Cloud logs\n\nFrom your app at `.streamlit.app`, click \"**Manage app**\" in the lower-right corner.\n\n![Access Streamlit Community Cloud logs from your app](/images/streamlit-community-cloud/cloud-logs-open.png)\n\nClick the overflow menu icon (more_vert) and click \"**Settings**.\"\n\n![Access app settings from your Cloud logs](/images/streamlit-community-cloud/cloud-logs-menu-settings.png)\n\n## Change your app settings\n\n### View or change your app's URL\n\nTo view or customize your app subdomain from the dashboard:\n\n1. Access your app's settings as described above.\n1. On the \"**General**\" tab in the \"App settings\" dialog, see your app's unique subdomain in the \"App URL\" field.\n\n ![General app settings on Streamlit Community Cloud: Custom subdomain](/images/streamlit-community-cloud/workspace-app-settings-general.png)\n\n1. Optional: Enter a new, custom subdomain between 6 and 63 characters in length, and then click \"**Save**.\"\n\n ![New custom subdomain for your app](/images/streamlit-community-cloud/workspace-app-settings-general-valid-domain.png)\n\n If a custom subdomain is not available (e.g. because it's already taken or contains restricted words), you'll see an error message. Change your subdomain as indicated.\n\n ![Invalid custom subdomain for your app](/images/streamlit-community-cloud/workspace-app-settings-general-invalid-domain.png)\n\n### Update your app's share settings\n\nLearn how to [Share your app](/deploy/streamlit-community-cloud/share-your-app).\n\n![Share settings on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-settings-sharing.png)\n\n### View or update your secrets\n\n1. Access your app's settings as described above.\n1. On the \"**Secrets**\" tab in the \"App settings\" dialog, see your app's secrets in the \"Secrets\" field.\n\n ![Secrets app settings on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-settings-secrets.png)\n\n1. Optional: Add, edit, or delete your secrets, and then click \"**Save**.\"\n\nLearn more about [Secrets management for your Community Cloud app](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/rename-your-app", - "content": "# Rename or change your app's GitHub coordinates\n\nStreamlit Community Cloud identifies apps by their GitHub coordinates (owner, repository, branch, entrypoint file path). If you move or rename one of these coordinates without preparation, you will lose access to administer any associated app.\n\n## Delete, rename, redeploy\n\nIf you need to rename your repository, move your entrypoint file, or otherwise change a deployed app's GitHub coordinates, do the following:\n\n1. Delete your app.\n1. Make your desired changes in GitHub.\n1. Redeploy your app.\n\n## Regain access when you've already made changes to your app's GitHub coordinates\n\nIf you have changed a repository so that Community Cloud can no longer find your app on GitHub, your app will be missing or shown as view-only. View-only means that you can't edit, reboot, delete, or view settings for your app. You can only access analytics.\n\nYou may be able to regain control as follows:\n\n1. Revert the change you made to your app so that Community Cloud can see the owner, repository, branch, and entrypoint file it expects.\n1. Sign out of Community Cloud and GitHub.\n1. Sign back in to Community Cloud and GitHub.\n1. If you have regained access, delete your app. Proceed with your original change, and redeploy your app.\n\n If this does not restore access to your app, please [contact Snowflake support](/knowledge-base/deploy/how-to-submit-a-support-case-for-streamlit-community-cloud) for assistance. They can delete your disconnected apps so you can redeploy them. For the quickest help, please provide a complete list of your affected apps by URL." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/upgrade-streamlit", - "content": "# Upgrade your app's Streamlit version on Streamlit Community Cloud\n\nWant to use a cool new Streamlit feature but your app on Streamlit Community Cloud is running an old version of the Streamlit library? If that's you, don't worry! Here's how to upgrade your app's Streamlit version, based on how you manage your [app dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies):\n\n## No dependency file\n\nWhen there is no dependencies file in your repository, your app will use the lastest Streamlit version that existed when it was last rebooted. In this case, simply [reboot your app](/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app) and Community Cloud will install the latest version.\n\nYou may want to avoid getting into this situation if your app depends on a specific version of Streamlit. That is why we encourage you to use a dependency file and pin your desired version of Streamlit.\n\n## With a dependency file\n\nWhen your app includes a dependency file, reboot your app or change your dependency file as follows:\n\n- If Streamlit is not included in your dependency file, reboot the app as described above.\n\n Note that we don't recommend having an incomplete dependency file since `pip` won't be able to include `streamlit` when resolving compatible versions of your dependencies.\n\n- If Streamlit is included in your dependency file, but the version is not pinned or capped, reboot the app as described above.\n\n When Community Cloud reboots your app, it will re-resolve your dependency file. Your app will then have the latest version of all dependencies that are consistent with your dependency file.\n\n- If Streamlit is included in your dependency file, and the version is pinned (e.g., `streamlit==1.37.0`), update your dependency file.\n\n When you commit a change to your dependency file in your repository, Community Cloud will detect the change and automatically resolve the new dependencies. This is how you add, remove, or change all Python dependencies in general. You don't need to manually reboot your app, but you can if you want to." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/delete-your-app", - "content": "# Delete your app\n\nIf you need to delete your app, it's simple and easy. There are several cases where you may need to delete your app:\n\n- You have finished playing around with an example app.\n- You want to deploy from a private repository but already have a private app.\n- You want to [change the Python version](/deploy/streamlit-community-cloud/manage-your-app/upgrade-python) for your app.\n- You want to [rename your repository](/deploy/streamlit-community-cloud/manage-your-app/rename-your-app) or move your entrypoint file.\n\nIf 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](/deploy/streamlit-community-cloud/get-started/trust-and-security#data-deletion).\n\nYou can delete your app:\n\n- [From your workspace](#delete-your-app-from-your-workspace).\n- [From your Cloud logs](#delete-your-app-from-your-cloud-logs).\n\n### Delete your app from your workspace\n\n1. From your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click \"**Delete**.\"\n\n ![Delete your app from your workspace](/images/streamlit-community-cloud/workspace-app-delete.png)\n\n2. A confirmation will display. Enter the required confirmation string and click \"**Delete**.\"\n\n
\n \"Confirm\n
\n\n### Delete your app from your Cloud logs\n\n1. From your app at `.streamlit.app`, click \"**Manage app**\" in the lower-right corner.\n\n ![Access Streamlit Community Cloud logs from your app](/images/streamlit-community-cloud/cloud-logs-open.png)\n\n2. Click the overflow menu icon (more_vert) and click \"**Delete app**.\"\n\n ![Delete your app from your Cloud logs](/images/streamlit-community-cloud/cloud-logs-menu-delete.png)\n\n3. A confirmation will display. Enter the required confirmation string and click \"**Delete**.\"\n\n
\n\"Confirm\n
" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/app-analytics", - "content": "# App analytics\n\nStreamlit Community Cloud allows you to see the viewership of each of your apps. Specifically, you can see:\n\n- The total viewers count of your app (counted from April 2022).\n- The most recent unique viewers (capped at the last 20 viewers).\n- A relative timestamp of each unique viewer's last visit.\n\n![App analytics on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-analytics-viewers.png)\n\n## Access your app analytics\n\nYou can get to your app's analytics:\n\n- [From your workspace](#access-app-analytics-from-your-workspace).\n- [From your Cloud logs](#access-app-analytics-from-your-cloud-logs).\n\n### Access app analytics from your workspace\n\nFrom your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click \"**Analytics**.\"\n\n![Access app analytics from your workspace through your app overflow menu](/images/streamlit-community-cloud/workspace-app-analytics.png)\n\n### Access app analytics from your Cloud logs\n\nFrom your app at `.streamlit.app`, click \"**Manage app**\" in the lower-right corner.\n\n![Access Streamlit Community Cloud logs from your app](/images/streamlit-community-cloud/cloud-logs-open.png)\n\nClick the overflow menu icon (more_vert) and click \"**Analytics**.\"\n\n![Access app analytics from your Cloud logs](/images/streamlit-community-cloud/cloud-logs-menu-analytics.png)\n\n## App viewers\n\nFor public apps, we anonymize all viewers outside your workspace to protect their privacy and display anonymous viewers as random pseudonyms. You'll still be able to see the identities of fellow members in your workspace, including any viewers you've invited (once they've accepted).\n\n\n\nWhen you invite a viewer to an app, they gain access to analytics as well. Additionally, if someone is invited as a viewer to _any_ app in your workspace, they can see analytics for all public apps in your workspace and invite additional viewers themselves. A viewer in your workspace may see the emails of developers and other viewers in your workspace through analytics.\n\n\n\nMeanwhile, for private apps where you control who has access, you will be able to see the specific users who recently viewed your apps.\n\nAdditionally, you may occasionally see anonymous users in a private app. Rest assured, these anonymous users _do_ have authorized view access granted by you or your workspace members.\n\nCommon reasons why users show up anonymously are:\n\n- The app was previously public.\n- The given viewer viewed the app in April 2022, when the Streamlit team was honing user identification for this feature.\n\nSee Streamlit's general Privacy Notice." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/favorite-your-app", - "content": "# Favorite your app\n\nStreamlit Community Cloud supports a \"favorite\" feature that lets you quickly access your apps from your workspace. Favorited apps appear at the top of their workspace with a yellow star (star) beside them. You can favorite and unfavorite apps in any workspace to which you have access as a developer or invited viewer.\n\n![Favorite apps appear on top in Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-two-apps.png)\n\n\n\nFavorites are specific to your account. Other members of your workspace cannot see which apps you have favorited.\n\n\n\n## Favoriting and unfavoriting your app\n\nYou can favorite your app:\n\n- [From your workspace](#favorite-your-app-from-your-workspace).\n- [From your app](#favorite-your-app-from-your-app-toolbar)!\n\n### Favorite your app from your workspace\n\n1. From your workspace at share.streamlit.io, hover over your app.\n\n If your app is not yet favorited, a star outline (star_border) will appear on hover.\n\n1. Click on the star (star_border/star) next to your app name to toggle its favorited status.\n\n### Favorite your app from your app toolbar\n\nFrom your app at `.streamlit.app`, click the star (star_border/star) in the upper-right corner to toggle your app's favorited status.\n\n![Favorite your app directly from your live app](/images/streamlit-community-cloud/favorite-select.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app", - "content": "# Manage your app\n\nYou can manage your deployed app from your workspace at share.streamlit.io or directly from `.streamlit.app`. You can view, deploy, delete, reboot, or favorite an app.\n\n## Manage your app from your workspace\n\nStreamlit Community Cloud is organized into workspaces, which automatically group your apps according to their repository's owner in GitHub. Your workspace is indicated in the upper-left corner. For more information, see [Switching workspaces](/deploy/streamlit-community-cloud/get-started/explore-your-workspace#switching-workspaces).\n\nTo deploy or manage any app, always switch to the workspace matching the repository's owner first.\n\n### Sort your apps\n\nIf you have many apps in your workspace, you can pin apps to the top by marking them as favorite (star). For more information, see [Favorite your app](/deploy/streamlit-community-cloud/manage-your-app/favorite-your-app).\n\n### App overflow menus\n\nEach app has a menu accessible from the overflow icon (more_vert) to the right.\n\n- **Edit with Codespaces** — See [Edit your app with GitHub Codespaces](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app#edit-your-app-with-github-codespaces)\n- **Reboot** — See [Reboot your app](/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app)\n- **Delete** — See [Delete your app](/deploy/streamlit-community-cloud/manage-your-app/delete-your-app)\n- **Analytics** — See [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics)\n- **Settings** — See [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings)\n\n![App overflow menu in your workspace](/images/streamlit-community-cloud/workspace-app-overflow.png)\n\nIf you have view-only access to an app, all options in the app's menu will be disabled except analytics.\n\n![View-only app overflow menu in your workspace](/images/streamlit-community-cloud/workspace-view-only.png)\n\n## Manage your app directly from your app\n\nYou can manage your deployed app directly from the app itself! Just make sure you are signed in to Community Cloud, and then visit your app.\n\n### Cloud logs\n\n1. From your app at `.streamlit.app`, click \"**Manage app**\" in the lower-right corner.\n\n ![Access Cloud logs from Manage app in the lower-right corner of your app](/images/streamlit-community-cloud/cloud-logs-open.png)\n\n2. Once you've clicked on \"**Manage app**\", you will be able to view your app's logs. This is your primary place to troubleshoot any issues with your app.\n\n ![Streamlit Community Cloud logs](/images/streamlit-community-cloud/cloud-logs.png)\n\n3. You can access more developer options by clicking the overflow icon (more_vert) at the bottom of your Cloud logs. To conveniently download your logs, click \"**Download log**.\"\n\n ![Download your Streamlit Community Cloud logs](/images/streamlit-community-cloud/cloud-logs-menu-download.png)\n\n\n\n
\n\nOther options accessible from Cloud logs are:\n\n- **Analytics** — See [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics).\n- **Reboot app** — See [Reboot your app](/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app).\n- **Delete app** — See [Delete your app](/deploy/streamlit-community-cloud/manage-your-app/delete-your-app).\n- **Settings** — See [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings).\n- **Your apps** — Takes you to your [app workspace](#manage-your-app-from-your-workspace).\n- **Documentation** — Takes you to our documentation.\n- **Support** — Takes you to our forums!\n\n
\n\n
\n \n
\n\n
\n\n### App chrome\n\nFrom your app at `.streamlit.app`, you can always access the [app chrome](/develop/concepts/architecture/app-chrome) just like you can when developing locally. The option to deploy your app is removed, but you can still clear your cache from here.\n\n![App menus in Streamlit Community Cloud](/images/streamlit-community-cloud/app-menu.png)\n\n## Manage your app in GitHub\n\n### Update your app\n\nYour GitHub repository is the source for your app, so that means that any time you push an update to your repository you'll see it reflected in the app in almost real time. Try it out!\n\nStreamlit also smartly detects whether you touched your dependencies, in which case it will automatically do a full redeploy for you—which will take a little more time. But since most updates don't involve dependency changes, you should usually see your app update in real time.\n\n### Add or remove dependencies\n\nTo add or remove dependencies at any point, just update `requirements.txt` (Python dependenciess) or `packages.txt` (Linux dependencies), and commit the changes to your repository on GitHub. Community Cloud detects the change in your dependencies and automatically triggers (re)installation.\n\nIt is best practice to pin your Streamlit version in `requirements.txt`. Otherwise, the version may be auto-upgraded at any point without your knowledge, which could lead to undesired results (e.g. when we deprecate a feature in Streamlit).\n\n## App resources and limits\n\n### Resource limits\n\nAll Community Cloud users have access to the same resources and are subject to the same limits. These limits may change at any time without notice. If your app meets or exceeds its limits, it may slow down from throttling or become nonfunctional. The limits as of February 2024 are approximately as follows:\n\n- CPU: 0.078 cores minimum, 2 cores maximum\n- Memory: 690MB minimum, 2.7GBs maximum\n- Storage: No minimum, 50GB maximum\n\nSymptoms that your app is running out of resources include the following:\n\n- Your app is running slowly.\n- Your app displays \"🤯 This app has gone over its resource limits.\"\n- Your app displays \"😦 Oh no.\"\n\n### Good for the world\n\nStreamlit offers increased resources for apps with good-for-the-world use cases. Generally, these apps are used by an educational institution or nonprofit organization, are part of an open-source project, or benefit the world in some way. If your app is **not** primarily used by a for-profit company you can [apply for increased resources](https://info.snowflake.com/streamlit-resource-increase-request.html).\n\n### Optimizing your app\n\nIf your app is running slow or showing the error pages mentioned above, we first highly recommend going through and implementing the suggestions in the following blog posts to prevent your app from hitting the resource limits and to detect if your Streamlit app leaks memory:\n\n- Common app problems: Resource limits\n- 3 steps to fix app memory leaks\n\nIf your app exceeds its resource limits, developers and viewers alike will see \"😦 Oh no.\"\n\n
\n\"App\n
\n\nIf see \"😦 Oh no.\" when viewing your app, first check your Cloud logs for any specific errors. If there are no errors in your Cloud logs you are likely dealing with a resource issue.\n\n#### Developer view\n\nIf you are signed in to a developer account for an app over its limits, you can access \"**Manage app**\" from the lower-right corner of the app to reboot it and clear its memory. \"**Manage app**\" will be red and have a warning icon (error).\n\n![Developer view: Oh no. Error running your app.](/images/streamlit-community-cloud/app-state-oh-no-developer.png)\n\n### App hibernation\n\nAll apps without traffic for 12 hours go to sleep. Community Cloud hibernates apps to conserve resources and allow the best communal use of the platform. To keep your app awake, simply visit your app.\n\nWhen someone visits a sleeping app, they will see the sleeping page:\n\n
\n\"App\n
\n\nTo wake the app up, click \"**Yes, get this app back up!**\" This can be done by *anyone* who has access to view the app, not just the app developer!\n\nYou can see which of your apps are asleep from your workspace. Sleeping apps have a moon icon (bedtime) to the right.\n\n![App state: Zzzz. This app has gone to sleep due to inactivity](/images/streamlit-community-cloud/workspace-sleeping-app.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/deploy", - "content": "# Deploy your app on Community Cloud\n\nAfter you've [organized your files](/deploy/streamlit-community-cloud/deploy-your-app/file-organization) and [added your dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies) as described on the previous pages, you're ready to deploy your app to Community Cloud!\n\n## Select your repository and entrypoint file\n\n1. From your workspace at share.streamlit.io, in the upper-right corner, click \"**Create app**.\"\n\n ![Deploy a new app from your workspace](/images/streamlit-community-cloud/deploy-empty-new-app.png)\n\n1. When asked \"Do you already have an app?\" click \"**Yup, I have an app**.\"\n1. Fill in your repository, branch, and file path. Alternatively, to paste a link directly to `your_app.py` on GitHub, click \"**Paste GitHub URL**.\"\n1. Optional: In the \"App URL\" field, choose a subdomain for your new app.\n\n Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings). In the following example, Community Cloud will deploy an app to `https://red-balloon.streamlit.app/`.\n\n ![Fill in your app's information to deploy your app](/images/streamlit-community-cloud/deploy-an-app.png)\n\n Although Community Cloud attempts to suggest available repositories and files, these suggestions are not always complete. If the desired information is not listed for any field, enter it manually.\n\n## Optional: Configure secrets and Python version\n\n\n\nStreamlit Community Cloud supports all released [versions of Python that are still receiving security updates](https://devguide.python.org/versions/). Streamlit Community Cloud defaults to version 3.12. You can select a version of your choice from the \"Python version\" dropdown in the \"Advanced settings\" modal. If an app is running a version of Python that becomes unsupported, it will be forcibly upgraded to the oldest supported version of Python and may break.\n\n\n\n1. Click \"**Advanced settings**.\"\n1. Select your desired version of Python.\n1. To define environment variables and secrets, in the \"Secrets\" field, paste the contents of your `secrets.toml` file.\n\n For more information, see [Community Cloud secrets management](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management).\n\n1. Click \"**Save**.\"\n\n
\n\"Advanced\n
\n\n## Watch your app launch\n\nYour app is now being deployed, and you can watch while it launches. Most apps are deployed within a few minutes, but if your app has a lot of dependencies, it may take longer. After the initial deployment, changes to your code should be reflected immediately in your app. Changes to your dependencies will be processed immediately, but may take a few minutes to install.\n\n![Watch your app launch](/images/streamlit-community-cloud/deploy-an-app-provisioning.png)\n\n\n\nThe Streamlit Community Cloud logs on the right-hand side of your app are only viewable to users with write access to your repository. These logs help you debug any issues with the app. Learn more about [Streamlit Community Cloud logs](/deploy/streamlit-community-cloud/manage-your-app#cloud-logs).\n\n\n\n\n\n## View your app\n\nThat's it—you're done! Your app now has a unique URL that you can share with others. Read more about how to [Share your app](/deploy/streamlit-community-cloud/share-your-app) with viewers.\n\n### Unique subdomains\n\nIf the \"**Custom subdomain (optional)**\" field is blank when you deploy your app, a URL is assigned following a structure based on your GitHub repo. The subdomain of the URL is a dash-separated list of the following:\n\n- Repository owner (GitHub user or organization)\n- Repository name\n- Entrypoint file path\n- Branch name, if other than `main` or `master`\n- A random hash\n\n```bash\nhttps://[GitHub username or organization]-[repo name]-[app path]-[branch name]-[short hash].streamlit.app\n```\n\nFor example, the following app is deployed from the `streamlit` organization. The repo is `demo-self-driving` and the app name is `streamlit_app.py` in the root directory. The branch name is `master` and therefore not included.\n\n```bash\nhttps://streamlit-demo-self-driving-streamlit-app-8jya0g.streamlit.app\n```\n\n### Custom subdomains\n\nSetting a custom subdomain makes it much easier to share your app because you can choose something memorable. To learn how to change the subdomain of a deployed app, see [View or change your app's URL](/deploy/streamlit-community-cloud/manage-your-app/app-settings#view-or-change-your-apps-url)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/file-organization", - "content": "# File organization for your Community Cloud app\n\nStreamlit Community Cloud copies all the files in your repository and executes `streamlit run` from its root directory. Because Community Cloud is creating a new Python environment to run your app, you need to include a declaration of any [App dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies) in addition to any [Configuration](/develop/concepts/configuration) options.\n\nYou can have multiple apps in your repository, and their entrypoint files can be anywhere in your repository. However, you can only have one configuration file. This page explains how to correctly organize your app, configuration, and dependency files. The following examples assume you are using `requirements.txt` to declare your dependencies because it is the most common. As explained on the next page, Community Cloud supports other formats for configuring your Python environment.\n\n## Basic example\n\nIn the following example, the entrypoint file (`your_app.py`) is in the root of the project directory alongside a `requirements.txt` file to declare the app's dependencies.\n\n```\nyour_repository/\n├── requirements.txt\n└── your_app.py\n```\n\nIf you are including custom configuration, your config file must be located at `.streamlit/config.toml` within your repository.\n\n```\nyour_repository/\n├── .streamlit/\n│ └── config.toml\n├── requirements.txt\n└── your_app.py\n```\n\nAdditionally, any files that need to be locally available to your app should be included in your repository.\n\n\n\nIf you have really big or binary data that you change frequently, and git is running slowly, you might want to check out [Git Large File Store (LFS)](https://git-lfs.github.com/) as a better way to store large files in GitHub. You don't need to make any changes to your app to start using it. If your GitHub repository uses LFS, it will _just work_ with Streamlit Community Cloud.\n\n\n\n## Use an entrypoint file in a subdirectory\n\nWhen your entrypoint file is in a subdirectory, the configuration file must stay at the root. However, your dependency file may be either at the root or next to your entrypoint file.\n\nYour dependency file can be at the root of your repository while your entrypoint file is in a subdirectory.\n\n```\nyour_repository/\n├── .streamlit/\n│ └── config.toml\n├── requirements.txt\n└── subdirectory\n └── your_app.py\n```\n\nAlternatively, your dependency file can be in the same subdirectory as your entrypoint file.\n\n```\nyour_repository/\n├── .streamlit/\n│ └── config.toml\n└── subdirectory\n ├── requirements.txt\n └── your_app.py\n```\n\nAlthough most Streamlit commands interpret paths relative to the entrypoint file, some commands interpret paths relative to the working directory. On Community Cloud, the working directory is always the root of your repository. Therefore, when developing and testing your app locally, execute `streamlit run` from the root of your repository. This ensures that paths are interpreted consistently between your local environment and Community Cloud.\n\nIn the previous example, this would look something like this:\n\n```bash\ncd your_repository\nstreamlit run subdirectory/your_app.py\n```\n\n\n Remember to always use forward-slash path separators in your paths. Community Cloud can't work with backslash-separated paths.\n\n\n## Multiple apps in one repository\n\nWhen you have multiple apps in one repository, they share the same configuration file (`.streamlit/config.toml`) at the root of your repository. A dependency file may be shared or configured separately for these multiple apps. To define separate dependency files for your apps, place each entrypoint file in its own subdirectory along with its own dependency file. To learn more about how Community Cloud prioritizes and parses dependency files, see [App dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies", - "content": "# App dependencies for your Community Cloud app\n\nThe main reason that apps fail to build properly is because Streamlit Community Cloud can't find your dependencies! There are two kinds of dependencies your app might have: Python dependencies and external dependencies. Python dependencies are other Python packages (just like Streamlit!) that you `import` into your script. External dependencies are less common, but they include any other software your script needs to function properly. Because Community Cloud runs on Linux, these will be Linux dependencies installed with `apt-get` outside the Python environment.\n\nFor your dependencies to be installed correctly, make sure you:\n\n1. Add a [requirements file](#add-python-dependencies) for Python dependencies.\n2. Optional: To manage any external dependencies, add a `packages.txt` file.\n\n\n\nPython requirements files should be placed either in the root of your repository or in the same\ndirectory as your app's entrypoint file.\n\n\n\n## Add Python dependencies\n\nWith each `import` statement in your script, you are bringing in a Python dependency. You need to tell Community Cloud how to install those dependencies through a Python package manager. We recommend using a `requirements.txt` file, which is based on `pip`.\n\nYou should _not_ include built-in Python libraries like `math`, `random`, or `distutils` in your `requirements.txt` file. These are a part of Python and aren't installed separately. Also, Community Cloud has `streamlit` installed by default. You don't strictly need to include `streamlit` unless you want to pin or restrict the version. If you deploy an app without a `requirements.txt` file, your app will run in an environment with just `streamlit` (and its dependencies) installed.\n\n\n\nThe version of Python you use is important! Built-in libraries change between versions of Python and other libraries may have specific version requirements, too. Whenever Streamlit supports a new version of Python, Community Cloud quickly follows to default to that new version of Python. Always develop your app in the same version of Python you will use to deploy it. For more information about setting the version of Python when you deploy your app, see [Optional: Configure secrets and Python version](/deploy/streamlit-community-cloud/deploy-your-app/deploy#optional-configure-secrets-and-python-version).\n\n\n\nIf you have a script like the following, no extra dependencies would be needed since `pandas` and `numpy` are installed as direct dependencies of `streamlit`. Similarly, `math` and `random` are built into Python.\n\n```python\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport math\nimport random\n\nst.write(\"Hi!\")\n```\n\nHowever, a valid `requirements.txt` file would be:\n\n```none\nstreamlit\npandas\nnumpy\n```\n\nAlternatively, if you needed to specify certain versions, another valid example would be:\n\n```none\nstreamlit==1.24.1\npandas>2.0\nnumpy<=1.25.1\n```\n\nIn the above example, `streamlit` is pinned to version `1.24.1`, `pandas` must be strictly greater than version 2.0, and `numpy` must be at-or-below version 1.25.1. Each line in your `requirements.txt` file is effectively what you would like to `pip install` into your cloud environment.\n\n\n To learn about limitations of Community Cloud's Python environments, see [Community Cloud status and limitations](/deploy/streamlit-community-cloud/status#python-environments).\n\n\n### Other Python package managers\n\nThere are other Python package managers in addition to `pip`. If you want to consider alternatives to using a `requirements.txt` file, Community Cloud will use the first dependency file it finds. Community Cloud will search the directory where your entrypoint file is, then it will search the root of your repository. In each location, dependency files are prioritized in the following order:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Recognized FilenamePython Package Manager
uv.lockuv
Pipfilepipenv
environment.ymlconda
requirements.txtpip
pyproject.tomlpoetry
\n\n† For efficiency, Community Cloud will attempt to process `requirements.txt` with `uv`, but will fall back to `pip` if needed. `uv` is generally faster and more efficient than `pip`.\n\n\n\nYou should only use one dependency file for your app. If you include more than one (e.g. `requirements.txt` and `environment.yaml`), only the first file encountered will be used as described above, with any dependency file in your entrypoint file's directory taking precedence over any dependency file in the root of your repository.\n\n\n\n## apt-get dependencies\n\nFor many apps, a `packages.txt` file is not required. However, if your script requires any software to be installed that is not a Python package, you need a `packages.txt` file. Community Cloud is built on Debian Linux. Anything you want to `apt-get install` must go in your `packages.txt` file. To browse available packages that can be installed, see the Debian 11 (\"bullseye\") [package list](https://packages.debian.org/bullseye/).\n\nIf `packages.txt` exists in the root directory of your repository we automatically detect it, parse it, and install the listed packages. You can read more about apt-get in Linux documentation.\n\nAdd **apt-get** dependencies to `packages.txt` — one package name per line. For example, mysqlclient is a Python package which requires additional software be installed to function. A valid `packages.txt` file to enable `mysqlclient` would be:\n\n```bash\n build-essential\n pkg-config\n default-libmysqlclient-dev\n```" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app", - "content": "# Prep and deploy your app on Community Cloud\n\nStreamlit Community Cloud lets you deploy your apps in just one click, and most apps will be deployed in only a few minutes. If you don't have an app ready to deploy, you can fork or clone one from our App gallery—you can find apps for machine learning, data visualization, data exploration, A/B testing, and more. You can also [Deploy an app from a template](/deploy/streamlit-community-cloud/get-started/deploy-from-a-template). After you've deployed your app, check out how you can [Edit your app with GitHub Codespaces](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app#edit-your-app-with-github-codespaces).\n\n\n\nIf you want to deploy your app on a different cloud service, see our [Deployment tutorials](/deploy/tutorials).\n\n\n\n## Summary\n\nThe pages that follow explain how to organize your app and provide complete information for Community Cloud to run it correctly.\n\nWhen your app has everything it needs, deploying is easy. Just go to your workspace and click \"**Create app**\" in the upper-right corner. Follow the prompts to fill in your app's information, and then click \"**Deploy**.\"\n\n![Deploy a new app from your workspace](/images/streamlit-community-cloud/deploy-empty-new-app.png)\n\n## Ready, set, go!\n\n\n Learn how Community Cloud initializes your app and interprets paths. Learn where to put your configuration files.\n Learn how to install dependencies and other Python libraries into your deployment environment.\n Learn about the interface Community Cloud provides to securely upload your secrets.toml data.\n Put it all together to deploy your app for the whole world to see.\n" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management", - "content": "# Secrets management for your Community Cloud app\n\n## Introduction\n\nIf you are [connecting to data sources](/develop/tutorials/databases), you will likely need to handle credentials or secrets. Storing unencrypted secrets in a git repository is a bad practice. If your application needs access to sensitive credentials, the recommended solution is to store those credentials in a file that is not committed to the repository and to pass them as environment variables.\n\n## How to use secrets management\n\nCommunity Cloud lets you save your secrets within your app's settings. When developing locally, you can use `st.secrets` in your code to read secrets from a `.streamlit/secrets.toml` file. However, this `secrets.toml` file should never be committed to your repository. Instead, when you deploy your app, you can paste the contents of your `secrets.toml` file into the \"**Advanced settings**\" dialog. You can update your secrets at any time through your app's settings in your workspace.\n\n### Prerequisites\n\n- You should understand how to use `st.secrets` and `secrets.toml`. See [Secrets management](/develop/concepts/connections/secrets-management).\n\n### Advanced settings\n\nWhile deploying your app, you can access \"**Advanced settings**\" to set your secrets. After your app is deployed, you can view or update your secrets through the app's settings. The deployment workflow is fully described on the next page, but the \"**Advanced settings**\" dialog looks like this:\n\n
\n\"Advanced\n
\n\nSimply copy and paste the contents of your local `secrets.toml` file into the \"Secrets\" field within the dialog. After you click \"**Save**\" to commit the changes, that's it!\n\n### Edit your app's secrets\n\nIf you need to add or edit your secrets for an app that is already deployed, you can access secrets through your [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings). See [View or update your secrets](/deploy/streamlit-community-cloud/manage-your-app/app-settings#view-or-update-your-secrets)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app/indexability", - "content": "# SEO and search indexability\n\nWhen you deploy a public app to Streamlit Community Cloud, it is automatically indexed by search engines like Google and Bing on a weekly basis. 🎈 This means that anyone can find your app by searching for its custom subdomain (e.g. \"traingenerator.streamlit.app\") or by searching for the app's title.\n\n## Get the most out of app indexability\n\nHere are some tips to help you get the most out of app indexability:\n\n1. [Make sure your app is public](#make-sure-your-app-is-public)\n2. [Choose a custom subdomain early](#choose-a-custom-subdomain-early)\n3. [Choose a descriptive app title](#choose-a-descriptive-app-title)\n4. [Customize your app's meta description](#customize-your-apps-meta-description)\n\n### Make sure your app is public\n\nAll public apps hosted on Community Cloud are indexed by search engines. If your app is private, it will not be indexed by search engines. To make your private app public, read [Share your app](/deploy/streamlit-community-cloud/share-your-app).\n\n### Choose a custom subdomain early\n\nCommunity Cloud automatically generates a subdomain for your app if you do not choose one. However, you can change your subdomain at any time! Custom subdomains modify your app URLs to reflect your app content, personal branding, or whatever you’d like. To learn how to change your app's subdomain, see [View or change your app's URL](/deploy/streamlit-community-cloud/manage-your-app/app-settings#view-or-change-your-apps-url).\n\nBy choosing a custom subdomain, you can use it to help people find your app. For example, if you're deploying an app that generates training data, you might choose a subdomain like `traingenerator.streamlit.app`. This makes it easy for people to find your app by searching for \"training generator\" or \"train generator streamlit app.\"\n\nWe recommend choosing a custom subdomain when you deploy your app. This ensures that your app is indexed by search engines using your custom subdomain, rather than the automatically generated one. If you choose a custom subdomain later, your app may be indexed multiple times—once using the default subdomain and once using your custom subdomain. In this case, your old URL will result in a 404 error which can confuse users who are searching for your app.\n\n### Choose a descriptive app title\n\nThe meta title of your app is the text that appears in search engine results. It is also the text that appears in the browser tab when your app is open. By default, the meta title of your app is the same as the title of your app. However, you can customize the meta title of your app by setting the [`st.set_page_config`](/develop/api-reference/configuration/st.set_page_config) parameter `page_title` to a custom string. For example:\n\n```python\nst.set_page_config(page_title=\"Traingenerator\")\n```\n\nThis will change the meta title of your app to \"Traingenerator.\" This makes it easier for people to find your app by searching for \"Traingenerator\" or \"train generator streamlit app\":\n\n\n\n### Customize your app's meta description\n\nMeta descriptions are the short descriptions that appear in search engine results. Search engines use the meta description to help users understand what your app is about.\n\nFrom our observations, search engines seem to favor the content in both `st.header` and `st.text` over `st.title`. If you put a description at the top of your app under `st.header` or `st.text`, there’s a good chance search engines will use this for the meta description.\n\n## What does my indexed app look like?\n\nIf you're curious about what your app looks like in search engine results, you can type the following into Google Search:\n\n```\nsite:.streamlit.app\n```\n\nExample: `site:traingenerator.streamlit.app`\n\n\n\n## What if I don't want my app to be indexed?\n\nIf you don't want your app to be indexed by search engines, you can make it private. Read [Share your app](/deploy/streamlit-community-cloud/share-your-app) to learn more about making your app private. Note: each workspace can only have one private app. If you want to make your app private, you must first delete any other private app in your workspace or make it public.\n\nThat said, Community Cloud is an open and free platform for the community to deploy, discover, and share Streamlit apps and code with each other. As such, we encourage you to make your app public so that it can be indexed by search engines and discovered by other Streamlit users and community members." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app/share-previews", - "content": "# Share previews\n\nSocial media sites generate a card with a title, preview image, and description when you share a link. This feature is called a \"share preview.\" In the same way, when you share a link to a public Streamlit app on social media, a share preview is also generated. Here's an example of a share preview for a public Streamlit app posted on Twitter:\n\n
\n \n \n \n
\n\n\n\nShare previews are generated only for public apps deployed on Streamlit Community Cloud.\n\n\n\n## Titles\n\nThe title is the text that appears at the top of the share preview. The text also appears in the browser tab when you visit the app. You should set the title to something that will make sense to your app's audience and describe what the app does. It is best practice to keep the title concise, ideally under 60 characters.\n\nThere are two ways to set the title of a share preview:\n\n1. Set the `page_title` parameter in [`st.set_page_config()`](/develop/api-reference/configuration/st.set_page_config) to your desired title. E.g.:\n\n ```python\n import streamlit as st\n\n st.set_page_config(page_title=\"My App\")\n\n # ... rest of your app\n ```\n\n2. If you don't set the `page_title` parameter, the title of the share preview will be the name of your app's GitHub repository. For example, the default title for an app hosted on GitHub at github.com/jrieke/traingenerator will be \"traingenerator\".\n\n## Descriptions\n\nThe description is the text that appears below the title in the share preview. The description should summarize what the app does and ideally should be under 100 characters.\n\nStreamlit pulls the description from the README in the app's GitHub repository. If there is no README, the description will default to:\n\n_This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈_\n\n
\n \n \n \n
\n\nIf you want your share previews to look great and want users to share your app and click on your links, you should write a good description in the README of your app’s GitHub repository.\n\n## Preview images\n\nStreamlit Community Cloud takes a screenshot of your app once a day and uses it as the preview image, unlike titles and descriptions which are pulled directly from your app's code or GitHub repository. This screenshot may take up to 24 hours to update.\n\n### Switching your app from public to private\n\nIf you initially made your app public and later decided to make it private, we will stop generating share previews for the app. However, it may take up to 24 hours for the share previews to stop appearing." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app/embed-your-app", - "content": "# Embed your app\n\nEmbedding Streamlit Community Cloud apps enriches your content by integrating interactive, data-driven applications directly within your pages. Whether you're writing a blog post, a technical document, or sharing resources on platforms like Medium, Notion, or even StackOverflow, embedding Streamlit apps adds a dynamic component to your content. This allows your audience to interact with your ideas, rather than merely reading about them or looking at screenshots.\n\nStreamlit Community Cloud supports both [iframe](#embedding-with-iframes) and [oEmbed](#embedding-with-oembed) methods for embedding **public** apps. This flexibility enables you to share your apps across a wide array of platforms, broadening your app's visibility and impact. In this guide, we'll cover how to use both methods effectively to share your Streamlit apps with the world.\n\n## Embedding with iframes\n\nStreamlit Community Cloud supports embedding **public** apps using the subdomain scheme. To embed a public app, add the query parameter `/?embed=true` to the end of the `*.streamlit.app` URL.\n\nFor example, say you want to embed the 30DaysOfStreamlit app. The URL to include in your iframe is: `https://30days.streamlit.app/?embed=true`:\n\n```javascript\n\n```\n\n\n\n\n\nThere will be no official support for embedding private apps.\n\n\n\nIn addition to allowing you to embed apps via iframes, the `?embed=true` query parameter also does the following:\n\n- Removes the toolbar with the app menu icon (more_vert).\n- Removes the padding at the top and bottom of the app.\n- Removes the footer.\n- Removes the colored line from the top of the app.\n\nFor granular control over the embedding behavior, Streamlit allows you to specify one or more instances of the `?embed_options` query parameter (e.g. to show the toolbar, open the app in dark theme, etc). [Click here for a full list of Embed options.](#embed-options)\n\n## Embedding with oEmbed\n\nStreamlit's oEmbed support allows for a simpler embedding experience. You can directly drop a Streamlit app's URL into a Medium, Ghost, or Notion page (or any of more than 700 content providers that supports oEmbed or embed.ly). The embedded app will automatically appear! This helps Streamlit Community Cloud apps seamlessly integrate into these platforms, improving the visibility and accessibility of your apps.\n\n### Example\n\nWhen creating content in a Notion page, Medium article, or Ghost blog, you only need to paste the app's URL and hit \"**Enter**.\" The app will then render automatically at that spot in your content. You can use your undecorated app URL without the `?embed=true` query parameter.\n\n```\nhttps://30days.streamlit.app/\n```\n\nHere's an example of @chrieke's Prettymapp app embedded in a Medium article:\n\n\"Example:\n\n\n\nEnsure the platform hosting the embedded Streamlit app supports oEmbed or embed.ly.\n\n\n\n### Key Sites for oEmbed\n\noEmbed should work out of the box for several platforms including but not limited to:\n\n- Medium\n- Notion\n- Looker\n- Tableau\n- Ghost\n- Discourse\n- StackOverflow\n- W3\n- Reddit\n\nPlease check the specific platform's documentation to verify support for oEmbed.\n\n### iframe versus oEmbed\n\nThe only noteworthy differences between the methods is that iframing allows you to customize the app's embedding behavior (e.g. showing the toolbar, opening the app in dark theme, etc) using the various `?embed_options` described in the next section.\n\n## Embed options\n\nWhen [Embedding with iframes](#embedding-with-iframes), Streamlit allows you to specify one or more instances of the `?embed_options` query parameter for granular control over the embedding behavior.\n\nBoth `?embed` and `?embed_options` are invisible to [`st.query_params`](/develop/api-reference/caching-and-state/st.query_params) and its precursors, [`st.experimental_get_query_params`](/develop/api-reference/caching-and-state/st.experimental_get_query_params) and [`st.experimental_set_query_params`](/develop/api-reference/caching-and-state/st.experimental_set_query_params). You can't get or set their values.\n\nThe supported values for `?embed_options` are listed below:\n\n1. Show the toolbar at the top right of the app which includes the app menu (more_vert), running man, and link to GitHub.\n\n ```javascript\n /?embed=true&embed_options=show_toolbar\n ```\n\n2. Show padding at the top and bottom of the app.\n\n ```javascript\n /?embed=true&embed_options=show_padding\n ```\n\n3. Show the footer reading \"Made with Streamlit.\" (This doesn't apply to Streamlit versions 1.29.0 and later since the footer was removed from the library.)\n\n ```javascript\n /?embed=true&embed_options=show_footer\n ```\n\n4. Show the colored line at the top of the app.\n\n ```javascript\n /?embed=true&embed_options=show_colored_line\n ```\n\n5. Hide the \"skeleton\" that appears while an app is loading.\n\n ```javascript\n /?embed=true&embed_options=hide_loading_screen\n ```\n\n6. Disable scrolling for the main body of the app. (The sidebar will still be scrollable.)\n\n ```javascript\n /?embed=true&embed_options=disable_scrolling\n ```\n\n7. Open the app with light theme.\n\n ```javascript\n /?embed=true&embed_options=light_theme\n ```\n\n8. Open the app with dark theme.\n\n ```javascript\n /?embed=true&embed_options=dark_theme\n ```\n\nYou can also combine the params:\n\n```javascript\n/?embed=true&embed_options=show_toolbar&embed_options=show_padding&embed_options=show_footer&embed_options=show_colored_line&embed_options=disable_scrolling\n```\n\n### Build an embed link\n\nYou can conveniently build an embed link for your app — right from your app!\n\n1. From your app at `.streamlit.app`, click \"**Share**\" in the upper-right corner.\n2. Click \"**Embed**\" to access a list of selectable embed options.\n\n ![Access embed options from the share button](/images/streamlit-community-cloud/share-menu-embed.png)\n\n3. Select your embed options and click \"**Get embed link**\" to copy the embed link to your clipboard.\n\n ![Build a customized embed link for your app from the share button](/images/streamlit-community-cloud/share-menu-embed-url.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app", - "content": "# Share your app\n\nNow that your app is deployed you can easily share it and collaborate on it. But first, let's take a moment and do a little joy dance for getting that app deployed! 🕺💃\n\nYour app is now live at a fixed URL, so go wild and share it with whomever you want. Your app will inherit permissions from your GitHub repo, meaning that if your repo is private your app will be private and if your repo is public your app will be public. If you want to change that you can simply do so from the app settings menu.\n\nYou are only allowed one private app at a time. If you've deployed from a private repository, you will have to make that app public or delete it before you can deploy another app from a private repository. Only developers can change your app between public and private.\n\n- [Make your app public or private](#make-your-app-public-or-private)\n- [Share your public app](#share-your-public-app)\n- [Share your private app](#share-your-private-app)\n\n## Make your app public or private\n\nIf you deployed your app from a public repository, your app will be public by default. If you deployed your app from a private repository, you will need to make the app public if you want to freely share it with the community at large.\n\n### Set privacy from your app settings\n\n1. Access your [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings) and go to the \"**Sharing**\" section.\n\n ![Share settings on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-settings-sharing.png)\n\n2. Set your app's privacy under \"Who can view this app.\" Select \"**This app is public and searchable**\" to make your app public. Select \"**Only specific people can view this app**\" to make your app private.\n\n ![Set your app's privacy in share settings](/images/streamlit-community-cloud/workspace-app-settings-sharing-change.png)\n\n### Set privacy from the share button\n\n1. From your app at `.streamlit.app`, click \"**Share**\" in the upper-right corner.\n\n ![Access the share button from your app](/images/streamlit-community-cloud/share-open.png)\n\n2. Toggle your app between public and private by clicking \"**Make this app public**.\"\n\n ![Toggle your app between public and private from the share button](/images/streamlit-community-cloud/share-menu-public-toggle.png)\n\n## Share your public app\n\nOnce your app is public, just give anyone your app's URL and they view it! Streamlit Community Cloud has several convenient shortcuts for sharing your app.\n\n### Share your app on social media\n\n1. From your app at `.streamlit.app`, click \"**Share**\" in the upper-right corner.\n2. Click \"**Social**\" to access convenient social media share buttons.\n\n ![Social media sharing links from the share button](/images/streamlit-community-cloud/share-menu-social.png)\n\n\n\nUse the social media sharing buttons to post your app on our forum! We'd love to see what you make and perhaps feature your app as our app of the month. 💖\n\n\n\n### Invite viewers by email\n\nWhether your app is public or private, you can send an email invite to your app directly from Streamlit Community Cloud. This grants the viewer access to analytics for all your public apps and the ability to invite other viewers to your workspace. Developers and invited viewers are identified by their email in analytics instead of appearing anonymously (if they view any of your apps while signed in). Read more about viewers in [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics).\n\n1. From your app at `.streamlit.app`, click \"**Share**\" in the upper-right corner.\n2. Enter an email address and click \"**Invite**.\"\n\n ![Invite viewers from the share button](/images/streamlit-community-cloud/share-invite-public.png)\n\n3. Invited users will get a direct link to your app in their inbox.\n\n ![Invitation email sent to viewers](/images/streamlit-community-cloud/share-invite-email.png)\n\n### Copy your app's URL\n\nFrom your app click \"**Share**\" in the upper-right corner then click \"**Copy link**.\"\n\n![Copy your app's URL from the share button](/images/streamlit-community-cloud/share-copy.png)\n\n### Add a badge to your GitHub repository\n\nTo help others find and play with your Streamlit app, you can add Streamlit's GitHub badge to your repo. Below is an enlarged example of what the badge looks like. Clicking on the badge takes you to—in this case—Streamlit's Roadmap.\n\n
\n
\n \n \"Open\n \n
\n
\n\nOnce you deploy your app, you can embed this badge right into your GitHub README.md by adding the following Markdown:\n\n```markdown\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://.streamlit.app)\n```\n\n\n\nBe sure to replace `https://.streamlit.app` with the URL of your deployed app!\n\n\n\n## Share your private app\n\nBy default an app deployed from a private repository will be private to the developers in the workspace. A private app will not be visible to anyone else unless you grant them explicit permission. You can grant permission by adding them as a developer on GitHub or by adding them as a viewer on Streamlit Community Cloud.\n\nOnce you have added someone's email address to your app's viewer list, that person will be able to sign in and view your private app. If their email is associated with a Google account, they will be able to sign in with Google OAuth. Otherwise, they will be able to sign in with single-use, emailed links. Streamlit sends an email invitation with a link to your app every time you invite someone.\n\n\n\nWhen you add a viewer to any app in your workspace, they are granted access to analytics for that app as well as analytics for all your public apps. They can also pass these permissions to others by inviting more viewers. All viewers and developers in your workspace are identified by their email in analytics. Furthermore, their emails show in analytics for every app in your workspace and not just apps they are explicitly invited to. Read more about viewers in [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics)\n\n\n\n### Invite viewers from the share button\n\n1. From your app at `.streamlit.app`, click \"**Share**\" in the upper-right corner.\n\n ![Access the share button from your app](/images/streamlit-community-cloud/share-open.png)\n\n2. Enter the email to send an invitation to and click \"**Invite**.\"\n\n ![Invite viewers from the share button](/images/streamlit-community-cloud/share-invite.png)\n\n3. Invited users appear in the list below.\n\n ![View invited users from the share button](/images/streamlit-community-cloud/share-invited.png)\n\n4. Invited users will get a direct link to your app in their inbox.\n\n ![Invitation email sent to viewers](/images/streamlit-community-cloud/share-invite-email.png)\n\n- To remove a viewer, simply access the share menu as above and click the close next to their name.\n\n ![Remove viewers from the share button](/images/streamlit-community-cloud/share-remove.png)\n\n### Invite viewers from your app settings\n\n1. Access your [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings) and go to the \"**Sharing**\" section.\n\n ![Access sharing settings from your app settings](/images/streamlit-community-cloud/workspace-app-settings-sharing.png)\n\n2. Add or remove users from the list of viewers. Click \"**Save**.\"\n\n ![Invite and remove viewers from your app settings](/images/streamlit-community-cloud/workspace-app-settings-sharing-invite.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account/sign-in-sign-out", - "content": "# Sign in & sign out\n\nAfter you've created your account, you can sign in to share.streamlit.io as described by the following options.\n\n![Sign in to Streamlit Community Cloud](/images/streamlit-community-cloud/account-sign-in.png)\n\n## Sign in with Google\n\n1. Click \"**Continue to sign-in**.\"\n1. Click \"**Continue with Google**.\"\n1. Enter your Google account credentials and follow the prompts.\n\nIf your account is already linked to GitHub, you may be immediately prompted to sign in with GitHub.\n\n## Sign in with GitHub\n\n1. Click \"**Continue to sign-in**.\"\n1. Click \"**Continue with GitHub**.\"\n1. Enter your GitHub credentials and follow the prompts.\n\n\n When you sign in with GitHub, Community Cloud will look for an account that uses the same email you have on your GitHub account. If such an account doesn't exist, Community Cloud will look for an account that uses your GitHub account for source control. In this latter instance, Community Cloud will update the email on your Community Cloud account to match the email on your GitHub account.\n\n\n## Sign in with Email\n\n1. Click \"**Continue to sign-in**.\"\n1. In the \"Email\" field, enter your email address.\n1. Click \"**Continue**.\" (If prompted, verify you are human.)\n1. Go to your email inbox, and copy your one-time, six-digit code. The code is valid for ten minutes.\n1. Return to the authentication page, and enter your code. (If prompted, verify you are human.)\n\nIf your account is already linked to GitHub, you may be immediately prompted to sign in with GitHub.\n\n## Sign out of your account\n\nFrom your workspace, click on your workspace name in the upper-left corner. Click \"**Sign out**.\"\n\n
\n\"Sign\n
" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account/manage-your-github-connection", - "content": "# Manage your GitHub connection\n\nIf you have created an account but not yet connected GitHub, see [Connect your GitHub account](/deploy/streamlit-community-cloud/get-started/connect-your-github-account).\n\nIf you have already connected your GitHub account but still need to allow Streamlit Community Cloud to access private repositories, see [Optional: Add access to private repositories](/deploy/streamlit-community-cloud/get-started/connect-your-github-account#optional-add-access-to-private-repositories).\n\n## Add access to an organization\n\nIf you are in an organization, you can grant or request access to that organization when you connect your GitHub account. For more information, see [Organization access](/deploy/streamlit-community-cloud/get-started/connect-your-github-account#organization-access).\n\nIf your GitHub account is already connected, you can remove permissions in your GitHub settings and force Streamlit to reprompt for GitHub authorization the next time you sign in to Community Cloud.\n\n### Revoke and reauthorize\n\n1. From your workspace, click on your workspace name in the upper-right corner. To sign out of Community Cloud, click \"**Sign out**.\" \n\n ![Sign out of Streamlit Community Cloud](/images/streamlit-community-cloud/account-sign-out.png)\n\n1. Go to your GitHub application settings at github.com/settings/applications.\n1. Find the \"Streamlit\" application, and click on the three dots (more_horiz) to open the overflow menu.\n\n If you have ever signed in to Community Cloud using GitHub, you will also see the \"Streamlit Community Cloud\" application in your GitHub account. The \"Streamlit\" application manages repository access. The \"Streamlit Community Cloud\" application is only for managing your identity (email) on Community Cloud. You only need to revoke access to the \"Streamlit\" application.\n\n1. Click \"**Revoke**.\"\n\n
\n \"Revoke\n
\n\n1. Click \"**I understand, revoke access**.\"\n\n
\n \"Confirm\n
\n\n1. Return to share.streamlit.io and sign in. You will be prompted to authorize GitHub as explained in [Connect GitHub](/deploy/streamlit-community-cloud/get-started/connect-your-github-account#organization-access).\n\n### Granting previously denied access\n\nIf an organization owner has restricted Streamlit's access or restricted all OAuth applications, they may need to directly modify their permissions in GitHub. If an organization has restricted Streamlit's access, a red X (close) will appear next to the organization when you are prompted to authorize with your GitHub account.\n\n
\n\"Denied\n
\n\nSee GitHub's documentation on OAuth apps and organizations.\n\n## Rename your GitHub account or repositories\n\nCommunity Cloud identifies apps by their GitHub coordinates (owner, repository, branch, entrypoint file path). If you rename your account or repository from which you've deployed an app, you will lose access to administer the app. To learn more, see [Rename your app in GitHub](/deploy/streamlit-community-cloud/manage-your-app/rename-your-app)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account/delete-your-account", - "content": "# Delete your account\n\nDeleting your Streamlit Community Cloud account is just as easy as creating it. When you delete your account, your information, account, and all your hosted apps are deleted as well. Read more about data deletion in [Streamlit trust and security](/deploy/streamlit-community-cloud/get-started/trust-and-security#data-deletion).\n\n\n\nDeleting your account is permanent and cannot be undone. Make sure you really want to delete your account and all hosted apps before proceeding. Any app you've deployed will be deleted, regardless of the workspace it was deployed from.\n\n\n\n## How to delete your account\n\nFollow these steps to delete your account:\n\n1. Sign in to Streamlit Community Cloud at share.streamlit.io and access your [Workspace settings](/deploy/streamlit-community-cloud/manage-your-account/workspace-settings).\n\n ![Delete your Streamlit Community Cloud account from your workspace settings](/images/streamlit-community-cloud/workspace-settings-linked-accounts.png)\n\n1. From the \"**Linked accounts**\" section, click \"**Delete account**.\"\n1. In the confirmation dialog, follow the prompt and click \"**Delete account forever**.\"\n\n All your information and apps will be permanently deleted.\n\n ![Your Streamlit Community Cloud account has been deleted.](/images/streamlit-community-cloud/account-deleted.png)\n\nIt's that simple! If you have any questions or run into issues deleting your account, please reach out to us on our forum. We're happy to help! 🎈" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account/update-your-email", - "content": "# Update your email\n\nTo update your email on Streamlit Community Cloud, you have two options: You can create a new account and merge your existing account into it, or you can use your GitHub account to update your email.\n\n## Option 1: Create a new account and merge it\n\nTwo Community Cloud accounts can't have the same GitHub account for source control. When you connect a GitHub account to a new Community Cloud account for source control, Community Cloud will automatically merge any existing account with the same source control.\n\nTherefore, you can create a new account with the desired email and connect the same GitHub account to merge them together.\n\n1. Create a new account with your new email.\n1. Connect your GitHub account.\n\nYour old and new accounts are now merged, and you have effectively changed your email address.\n\n## Option 2: Use your GitHub account\n\nAlternatively, you can change the email on your GitHub account and then sign in to Community Cloud with GitHub.\n\n1. Go to GitHub, and set your primary email address to your new email.\n1. If you are currently signed in to Community Cloud, sign out.\n1. Sign in to Community Cloud _using GitHub_.\n\n If you are redirected to your workspace and you see your existing apps, you're done! Your email has been changed. To confirm your current email and GitHub account, click on your workspace name in the upper-left corner, and look at the bottom of the drop-down menu.\n\n If you are redirected to an empty workspace and you see \"**Workspaces warning**\" in the upper-left corner, proceed to [Connect your GitHub account](/deploy/streamlit-community-cloud/get-started/connect-your-github-account). This can happen if you previously created an account with your new email but didn't connect a GitHub account to it.\n\n\n If you have multiple GitHub accounts, be careful. To avoid unexpected behavior, either use unique emails on each GitHub account or avoid signing in to Community Cloud using GitHub.\n" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account", - "content": "# Manage your account\n\nYou can [Update your email](/deploy/streamlit-community-cloud/manage-your-account/update-your-email) or completely [Delete your account](/deploy/streamlit-community-cloud/manage-your-account/delete-your-account) through [Workspace settings](/deploy/streamlit-community-cloud/manage-your-account/workspace-settings).\n\nYour Streamlit Community Cloud account is identified by your email. When you sign in to Community Cloud, regardless of which method you use, you are providing Community Cloud with your email address. In particular, when you sign in to Community Cloud using GitHub, you are using the primary email on your GitHub account. You can view your email identity and source-control identity from your workspace settings, under \"[**Linked accounts**](/deploy/streamlit-community-cloud/manage-your-account/workspace-settings#linked-accounts).\"\n\n## Access your workspace settings\n\n1. Sign in to share.streamlit.io.\n1. In the upper-left corner, click on your workspace name.\n1. In the drop-down menu, click \"**Settings**.\"\n\n
\n \"Access\n
" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-account/workspace-settings", - "content": "# Workspace settings\n\nFrom your workspace settings you can [Manage your account](/deploy/streamlit-community-cloud/manage-your-account), see your [App resources and limits](/deploy/streamlit-community-cloud/manage-your-app#app-resources-and-limits) and access support resources.\n\n## Access your workspace settings\n\n1. Sign in to share.streamlit.io.\n1. In the upper-left corner, click on your workspace name.\n1. In the drop-down menu, click \"**Settings**.\"\n\n ![Access your workspace settings from your workspace](/images/streamlit-community-cloud/account-settings-header.png)\n\n## Linked accounts\n\nThe \"**Linked accounts**\" section shows your current email identity and source control account. To learn more, see [Manage your account](/deploy/streamlit-community-cloud/manage-your-account).\n\n![Manage your linked accounts in workspace settings](/images/streamlit-community-cloud/workspace-settings-linked-accounts.png)\n\n## Limits\n\nThe \"**Limits**\" section shows your current resources and limits. To learn more, see [App resources and limits](/deploy/streamlit-community-cloud/manage-your-app#app-resources-and-limits).\n\n![Resource limits displayed in workspace settings](/images/streamlit-community-cloud/workspace-settings-limits.png)\n\n## Support\n\nThe \"**Support**\" section provides a convenient list of useful resources so you know where to go for help.\n\n![Support options available through workspace settings](/images/streamlit-community-cloud/workspace-settings-support.png)" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/explore-your-workspace", - "content": "# Explore your workspace\n\nIf you just [created your account](/deploy/streamlit-community-cloud/get-started/create-your-account) and [connected your GitHub account](/deploy/streamlit-community-cloud/get-started/connect-your-github-account), congrats! You are now signed in and ready to go. If you are joining someone else's workspace you may already see some apps.\n\n## Workspaces\n\nEach GitHub account and organization is associated with a workspace in Community Cloud. When you sign in to Community Cloud for the first time, you will land in your personal workspace associated with your GitHub user account. The upper-left corner of Community Cloud shows your current workspace.\n\n![A new, empty workspace in Streamlit Community Cloud. The workspace owner is displayed in the upper-left corner.](/images/streamlit-community-cloud/workspace-empty-SM.png)\n\n### Switching workspaces\n\nTo switch between workspaces, click the workspace name in the upper-left corner and select a new workspace.\n\nOther workspaces are available to you as follows:\n\n- When you have write permissions to a repository and the repository owner has joined Community Cloud, you can select the associated workspace. An owner can be a GitHub user or organization.\n- If someone has shared an app with you through Community Cloud, you will see the app's associated workspace. This is view-only access.\n\n![This workspace is for the user `sammy-streamlit`, who has access to their personal workspace and another workspace for the organization `we-love-streamlit`.](/images/streamlit-community-cloud/workspace-empty-switch.png)\n\n### Invite other developers to your workspace\n\nInviting other developers is simple: Just give them write access to your GitHub repository so that you can code together. When they sign in to share.streamlit.io, they'll have access to your workspace.\n\nStreamlit Community Cloud inherits developer permissions from GitHub. When others sign in to Community Cloud, they will automatically see the workspaces they share with you. From there you can all deploy, manage, and share apps together.\n\n\n\nWhen a user is added to a repository on GitHub, it will take at most 15 minutes before they can deploy or manage the app on Community Cloud. If a user is removed from a repository on GitHub, it will take at most 15 minutes before their permission to manage the app from that repository is revoked.\n\n\n\nAnd remember, whenever anyone on the team updates the code on GitHub, the app will automatically update for you!\n\n## My apps\n\nThe \"**My apps**\" section of your workspace is your base of operations to deploy and manage your apps. When you deploy an app, it is added to this section of your workspace.\n\n### Deploying apps\n\nIf you already have an app saved to a GitHub repo, you can deploy it directly. Otherwise, Community Cloud provides templates you can use. When you deploy from a template, Community Cloud will fork a project into your GitHub account and deploy from the new fork. This is a convenient way to get started if you haven't already created a Streamlit app.\n\nTo get started, just click \"**Create app**\" in the upper-right corner. To learn more, see [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app) and [Deploy from a template](/deploy/streamlit-community-cloud/get-started/deploy-from-a-template).\n\n## My profile\n\nThe \"**My profile**\" section of your workspace lets you customize a personal portfolio of Streamlit apps to share with the world. Curate and feature your Streamlit apps to show off your work.\n\n## Explore\n\nFor inspiration, check out the \"**Explore**\" section. This is a gallery of Streamlit apps created by the Streamlit community. Check out popular and trending apps, or search for apps in an area that interests you." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/quickstart", - "content": "# Quickstart\n\nThis is a concise set of steps to create your Streamlit Community Cloud account, deploy a sample app, and start editing it with GitHub Codespaces. For other options and complete explanations, start with [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account).\n\nYou will sign in to your GitHub account during this process. Community Cloud will use the email from your GitHub account to create your Community Cloud account. For other sign-in options, see [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account).\n\n## Prerequisites\n\n- You must have a GitHub account.\n\n## Sign up for Streamlit Community Cloud\n\n1. Go to share.streamlit.io.\n1. Click \"**Continue to sign-in**.\"\n1. Click \"**Continue with GitHub**.\"\n1. Enter your GitHub credentials and follow GitHub's authentication prompts.\n1. Fill in your account information, and click \"**I accept**\" at the bottom.\n\n## Add access to your public repositories\n\n1. In the upper-left corner, click \"**Workspaces warning**.\"\n\n
\n\"Connect\n
\n\n1. From the drop down, click \"**Connect GitHub account**.\"\n1. Enter your GitHub credentials and follow GitHub's authentication prompts.\n1. Click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n## Optional: Add access to private repositories\n\n1. In the upper-left corner, click on your GitHub username.\n\n
\n\"Access\n
\n\n1. From the drop down, click \"**Settings**.\"\n1. On the left side of the dialog, select \"**Linked accounts**.\"\n1. Under \"Source control,\" click \"**Connect here arrow_forward**.\"\n1. Click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n## Create a new app from a template\n\n1. In the upper-right corner, click \"**Create app**.\"\n\n
\n\"Create\n
\n\n1. When asked \"Do you already have an app?\" click \"**Nope, create one from a template**.\"\n1. From the list of templates on the left, select \"**Blank app**.\"\n1. At the bottom, select the option to \"**Open GitHub Codespaces...**\"\n1. At the bottom, click \"**Deploy**.\"\n\n## Edit your app in GitHub Codespaces\n\n1. Wait for GitHub to set up your codespace.\n\n It can take several minutes to fully initialize your codespace. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file.\n\n
\n \"Your\n
\n\n1. Go to the app's entrypoint file (`streamlit_app.py`) in the left pane, and change line 3 by adding \"Streamlit\" inside `st.title`.\n\n ```diff\n -st.title(\"🎈 My new app\")\n +st.title(\"🎈 My new Streamlit app\")\n ```\n\n Files are automatically saved in your codespace with each edit.\n\n1. A moment after typing a change, your app on the right side will display a rerun prompt. Click \"**Always rerun**.\"\n\n
\n \"Edit\n
\n\n If the rerun prompt disappears before you click it, you can hover over the overflow menu icon (more_vert) to bring it back.\n\n1. Optional: Continue to make edits and observe the changes within seconds.\n\n## Publish your changes\n\n1. In the left navigation bar, click the source control icon.\n\n
\n\"See\n
\n\n1. In the source control sidebar on the left, enter a name for your commit.\n1. Click \"**check Commit**.\"\n\n
\n\"See\n
\n\n1. To stage and commit all your changes, in the confirmation dialog, click \"**Yes**.\" Your changes are committed locally in your codespace.\n1. To push your commit to GitHub, in the source control sidebar on the left, click \"**cached 1 arrow_upward**.\"\n1. To push commits to \"origin/main,\" in the confirmation dialog, click \"**OK**.\" \n\n Your changes are now saved to your GitHub repository. Community Cloud will immediately reflect the changes in your deployed app.\n\n1. Optional: To see your updated, published app, return to the \"**My apps**\" section of your workspace at share.streamlit.io, and click on your app.\n\n## Stop or delete your codespace\n\nWhen you stop interacting with your codespace, GitHub will generally stop your codespace for you. However, the surest way to avoid undesired use of your capacity is to stop or delete your codespace when you are done.\n\n1. Go to github.com/codespaces. At the bottom of the page, all your codespaces are listed. Click the overflow menu icon (more_horiz) for your codespace.\n\n
\n\"Stop\n
\n\n2. If you want to return to your work later, click \"**Stop codespace**.\" Otherwise, click \"**Delete**.\"\n\n
\n \"Stop\n
\n\n3. Congratulations! You just deployed an app to Streamlit Community Cloud. 🎉 Return to your workspace at share.streamlit.io/ and [deploy another Streamlit app](/deploy/streamlit-community-cloud/deploy-your-app).\n\n
\n \"See\n
" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/deploy-from-a-template", - "content": "# Deploy an app from a template\n\nStreamlit Community Cloud makes it easy to get started with several convenient templates. Just pick a template, and Community Cloud will fork it to your account and deploy it. Any edits you push to your new fork will immediately show up in your deployed app. Additionally, if you don't want to use a local development environment, Community Cloud makes it easy to create a GitHub codespace that's fully configured for Streamlit app development.\n\n## Access the template picker\n\nThere are two ways to begin deploying a template: the \"**Create app**\" button and the template gallery at the bottom of your workspace.\n\n- If you click the \"**Create app**\" button, Community Cloud will ask you \"Do you already have an app?\" Select \"**Nope, create one from a template**.\"\n- If you scroll to the bottom of your workspace in the \"**My apps**\" section, you can see the most popular templates. Click on one directly, or select \"**View all templates**.\"\n\nThe template picker shows a list of available templates on the left. A preview for the current, selected template shows on the right.\n\n![\"Deploy from a template\" page on Community Cloud](/images/streamlit-community-cloud/deploy-template-picker.png)\n\n## Select a template\n\n1. From the list of templates on the left, select \"**GDP dashboard**.\"\n1. Optional: For \"Name of new GitHub repository,\" enter a name for your new, forked repository.\n\n When you deploy a template, Community Cloud forks the template repository into your GitHub account. Community Cloud chooses a default name for this repository based on the selected template. If you have previously deployed the same template with its default name, Community Cloud will append an auto-incrementing number to the name.\n\n \n Even if you have another user's or organization's workspace selected, Community Cloud will always deploy a template app from your personal workspace. That is, Community Cloud will always fork a template into your GitHub user account. If you want to deploy a template app from an organization, manually fork the template in GitHub, and deploy it from your fork in the associated workspace.\n \n\n1. Optional: In the \"App URL\" field, choose a subdomain for your new app.\n\n Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings).\n\n1. Optional: To edit the template in a GitHub codespace immediately, select the option to \"**Open GitHub Codespaces...**\"\n\n You can create a codespace for your app at any time. To learn how to create a codespace after you've deployed an app, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app).\n\n1. Optional: To change the version of Python, at the bottom of the screen, click \"**Advanced settings**,\" select a Python version, and then click \"**Save**.\"\n\n \n After an app is deployed, you can't change the version of Python without deleting and redeploying the app. \n \n\n1. At the bottom, click \"**Deploy**.\"\n\n## View your app\n\n- If you didn't select the option to open GitHub Codespaces, you are redirected to your new app.\n\n ![GDP dashboard template app](/images/streamlit-community-cloud/deploy-template-GDP.png)\n\n- If you selected the option to open GitHub Codespaces, you are redirected to your new codespace, which can take several minutes to be fully initialized. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file.\n\n ![GDP dashboard template app in a codespace](/images/streamlit-community-cloud/deploy-template-GDP-codespace.png)\n\n\n The app displayed in your codespace is not the same instance you deployed on Community Cloud. Your codespace is a self-contained development environment. When you make edits inside a codespace, those edits don't leave the codespace until you commit them to your repository. When you commit your changes to your repository, Community Cloud detects the changes and updates your deployed app. To learn more, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app).\n" - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/connect-your-github-account", - "content": "# Connect your GitHub account\n\nConnecting GitHub to your Streamlit Community Cloud account allows you to deploy apps directly from the files you store in your repositories. It also lets the system check for updates to those files and automatically update your apps. When you first connect your GitHub account to your Community Cloud account, you'll be able to deploy apps from your public repositories to Community Cloud. If you want to deploy from private repositories, you can give Community Cloud additional permissions to do so. For more information about these permissions, see [GitHub OAuth scope](/deploy/streamlit-community-cloud/status#github-oauth-scope).\n\n\n In order to deploy an app, you must have **admin** permissions to its repository. If you don't have admin access, contact the repository's owner or fork the repository to create your own copy. For more help, see our community forum.\n\n\nIf you are a member of a GitHub organization, that organization is displayed at the bottom of each GitHub OAuth prompt. In this case, we recommend reading about [Organization access](#organization-access) at the end of this page before performing the steps to connect your GitHub account. You must be an organization's owner in GitHub to grant access to that organization.\n\n## Prerequisites\n\n- You must have a Community Cloud account. See [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account).\n- You must have a GitHub account.\n\n## Add access to public repositories\n\n1. In the upper-left corner, click \"**Workspaces warning**.\"\n\n
\n\"Connect\n
\n\n1. From the drop down, click \"**Connect GitHub account**.\"\n1. Enter your GitHub credentials and follow GitHub's authentication prompts.\n1. Click \"**Authorize streamlit**.\"\n\n
\n \"Authorize\n
\n\n This adds the \"Streamlit\" OAuth application to your GitHub account. This allows Community Cloud to work with your public repositories and create codespaces for you. In the next section, you can allow Community Cloud to access your private repositories, too. For more information about using and reviewing the OAuth applications on your account, see [Using OAuth apps](https://docs.github.com/en/apps/oauth-apps/using-oauth-apps) in GitHub's docs.\n\n## Optional: Add access to private repositories\n\nAfter your Community Cloud account has access to deploy from your public repositories, you can follow these additional steps to grant access to your private repositories.\n\n1. In the upper-left corner, click on your GitHub username.\n\n
\n\"Access\n
\n\n1. From the drop down, click \"**Settings**.\"\n1. On the left side of the dialog, select \"**Linked accounts**.\"\n1. Under \"Source control,\" click \"**Connect here arrow_forward**.\"\n1. Click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n## Organization access\n\nTo deploy apps from repositories owned by a GitHub organization, Community Cloud must have permission to access the organization's repositories. If you are a member of a GitHub organization when you connect your GitHub account, your OAuth prompts will include a section labeled \"Organization access.\"\n\n
\n\"GitHub\n
\n\nIf you have already connected your GitHub account and need to add access to an organization, follow the steps in [Manage your GitHub connection](/deploy/streamlit-community-cloud/manage-your-account/manage-your-github-connection) to disconnect your GitHub account and start over. Alternatively, if you are not the owner of an organization, you can ask the owner to create a Community Cloud account for themselves and add permission directly.\n\n### Organizations you own\n\nFor any organization you own, if authorization has not been previously granted or denied, you can click \"**Grant**\" before you click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n### Organizations owned by others\n\nFor an organization you don't own, if authorization has not been previously granted or denied, you can click \"**Request**\" before you click \"**Authorize streamlit**.\"\n\n
\n\"Authorize\n
\n\n### Previous or pending authorization\n\nIf someone has already started the process of authorizing Streamlit for your organization, the OAuth prompt will show the current status.\n\n#### Approved access\n\nIf an organization has already granted Streamlit access, the OAuth prompt shows a green check (check).\n\n
\n\"Approved\n
\n\n#### Pending access\n\nIf a request has been previously sent but not yet approved, the OAuth prompt show \"Access request pending.\" Follow up with the organization's owner to accept the request in GitHub.\n\n
\n\"Pending\n
\n\n#### Denied access\n\nIf a request has been previously sent and denied, the OAuth prompt shows a red X (close). In this case, the organization owner will need to authorize Streamlit from GitHub. See GitHub's documentation on OAuth apps and organizations.\n\n
\n\"Denied\n
\n\n## What's next?\n\nNow that you have your account you can [Explore your workspace](/deploy/streamlit-community-cloud/get-started/explore-your-workspace). Or if you're ready to go, jump right in and [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/create-your-account", - "content": "# Create your account\n\nBefore you can start deploying apps for the world to see, you need to sign up for your Streamlit Community Cloud account.\n\nEach Community Cloud account is associated with an email. Two accounts can't have the same email. When sharing a private app, you will assign viewing privileges by email. Additionally, two accounts can't have the same source control (GitHub account). If you try to create a second Community Cloud account with the same source control, Community Cloud will merge the accounts.\n\n## Sign up\n\nCommunity Cloud allows you to sign in using one of the three following methods:\n\n- Emailed, one-use codes\n- Google\n- GitHub\n\n\n Even when you sign in through GitHub, the authentication flow returns your email address to Community Cloud. Changing the email on your GitHub account can affect your Community Cloud account if you sign in through GitHub.\n\n\n1. Go to share.streamlit.io.\n1. Click \"**Continue to sign-in**.\"\n1. Continue with one of the three options listed below.\n\n ### Option 1: Sign in using emailed codes\n\n 1. In the \"Email\" field, enter your email address.\n 1. Click \"**Continue**.\" (If prompted, verify you are human.)\n 1. Go to your email inbox, and copy your one-time, six-digit code. The code is valid for ten minutes.\n 1. Return to the authentication page, and enter your code. (If prompted, verify you are human.)\n\n ### Option 2: Sign in using Google\n\n 1. Click \"**Continue with Google**.\"\n 1. Enter your Google credentials, and follow Google's authentication prompts.\n\n ### Option 3: Sign in using GitHub\n\n 1. Click \"**Continue with GitHub**.\"\n 1. Enter your GitHub credentials, and follow GitHub's authentication prompts.\n\n This adds the \"Streamlit Community Cloud\" OAuth application to your GitHub account. This application is only used to pass your email when you sign in to Community Cloud. On the next page, you'll perform additional steps to allow Community Cloud to access your repositories. For more information about using and reviewing the OAuth applications on your account, see [Using OAuth apps](https://docs.github.com/en/apps/oauth-apps/using-oauth-apps) in GitHub's docs.\n\n1. Fill in your information, and click \"**Continue**\" at the bottom.\n\n The \"Primary email\" field is prefilled with the email you used to sign in. If you change this email in the account setup form, it will only impact marketing emails; it will not reflect on your new account. To change the email associated with your account after it's created, see [Update your email address](/deploy/streamlit-community-cloud/manage-your-account/update-your-email).\n\n## Finish up\n\nCongratulations on creating your Streamlit Community Cloud account! A warning icon (warning) next to \"**Workspaces**\" in the upper-left corner is expected; this indicates that your account is not yet connected to GitHub. Even if you created your account by signing in through GitHub, your account does not yet have permission to access your repositories. Continue to the next page to connect your GitHub account." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/fork-and-edit-a-public-app", - "content": "# Fork and edit a public app\n\nCommunity Cloud is all about learning, sharing, and exploring the world of Streamlit. For apps with public repositories, you can quickly fork copies to your GitHub account, deploy your own version, and jump into a codespace on GitHub to start editing and exploring Streamlit code.\n\n1. From a forkable app, in the upper-right corner, click \"**Fork**.\"\n\n ![Click Fork in the upper-right corner of a public app](/images/streamlit-community-cloud/fork-public-hello.png)\n\n1. Optional: In the \"App URL\" field, choose a custom subdomain for your app.\n\n Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings).\n\n1. Click \"**Fork!**\"\n\n The repository will be forked to your GitHub account. If you have already forked the repository, Community Cloud will use the existing fork. If your existing fork already has an associated codespace, the codespace will be reused.\n\n \n Do not use this method in the following situations:\n - You have an existing repository that matches the fork name (but isn't a fork of this app).\n - You have an existing fork of this app, but you've changed the name of the repository.\n\n If you have an existing fork of this app and kept the original repository name, Community Cloud will use your existing fork. If you've previously deployed the app and opened a codespace, Community Cloud will open your existing codespace.\n \n\n ![Click Fork to confirm and deploy your app](/images/streamlit-community-cloud/fork-public-hello-deploy.png)\n\n1. Wait for GitHub to set up your codespace.\n\n It can take several minutes to fully initialize your codespace. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file.\n\n ![Click Fork to confirm and deploy your app](/images/streamlit-community-cloud/fork-public-hello-codespace.png)\n\n \n The app displayed in your codespace is not the same instance you deployed on Community Cloud. Your codespace is a self-contained development environment. When you make edits inside a codespace, those edits don't leave the codespace until you commit them to your repository. When you commit your changes to your repository, Community Cloud detects the changes and updates your deployed app. To learn more, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app).\n \n\n1. Edit your newly forked app as desired. For more instructions on working with GitHub Codespaces, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/trust-and-security", - "content": "# Streamlit trust and security\n\nStreamlit is a framework that turns Python scripts into interactive apps, giving data scientists the ability to quickly create data and model-based apps for the entire company.\n\nA simple Streamlit app is:\n\n```python\nimport streamlit as st\nnumber = st.slider(\"Pick a number: \", min_value=1, max_value=10)\nst.text(\"Your number is \" + str(number))\n```\n\nWhen you `streamlit run my_app.py`, you start a web server that runs the interactive application on your local computer at `http://localhost:8501`. This is great for local development. When you want to share with your colleagues, Streamlit Community Cloud enables you to deploy and run these applications in the cloud. Streamlit Community Cloud handles the details of containerization and provides you an interface for easily managing your deployed apps.\n\nThis document provides an overview of the security safeguards we've implemented to protect you and your data. Security, however, is a shared responsibility and you are ultimately responsible for making appropriate use of Streamlit and the Streamlit Community Cloud, including implementation of appropriate user-configurable security safeguards and best practices.\n\n## Product security\n\n### Authentication\n\nYou must authenticate through GitHub to deploy or administer an app. Authentication through Google or single-use emailed links are required to view a private app when you don't have push or admin permissions on the associated GitHub repository. The single-use emailed links are valid for 15 minutes once requested.\n\n### Permissions\n\nStreamlit Community Cloud inherits the permissions you have assigned in GitHub. Users with write access to a GitHub repository for a given app will be able to make changes in the Streamlit administrative console. However, only users with _admin access_ to a repository are able to **deploy and delete apps**.\n\n## Network and application security\n\n### Data hosting\n\nOur physical infrastructure is hosted and managed within secure data centers maintained by infrastructure-as-a-service cloud providers. Streamlit leverages many of these platforms' built-in security, privacy, and redundancy features. Our cloud providers continually monitor their data centers for risk and undergo assessments to ensure compliance with industry standards.\n\n### Data deletion\n\nCommunity Cloud users have the option to delete any apps they’ve deployed as well as their entire account.\n\nWhen a user deletes their application from the admin console, we delete their source code, including any files copied from their GitHub repository or created within our system from the running app. However, we keep a record representing the application in our database. This record contains the coordinates of the application: the GitHub organization or user, the GitHub repository, the branch, and the path of the main module file.\n\nWhen a user deletes their account, we perform a hard deletion of their data and a hard deletion of all the apps that belong to the GitHub identity associated with their account. In this case, we do not maintain the records of application coordinates described above. When an account is deleted, we also delete any HubSpot contact associated with the Community Cloud account.\n\n### Virtual private cloud\n\nAll of our servers are within a virtual private cloud (VPC) with firewalls and network access control lists (ACLs) to allow external access to a select few API endpoints; all other internal services are only accessible within the VPC.\n\n### Encryption\n\nStreamlit apps are served entirely over HTTPS. We use only strong cipher suites and HTTP Strict Transport Security (HSTS) to ensure browsers interact with Streamlit apps over HTTPS.\n\nAll data sent to or from Streamlit over the public internet is encrypted in transit using 256-bit encryption. Our API and application endpoints use Transport Layer Security (TLS) 1.2 (or better). We also encrypt data at rest on disk using AES-256.\n\n### Permissions and authentication\n\nAccess to Community Cloud user account data is limited to authorized personnel. We run a zero-trust corporate network, utilize single sign-on and multi-factor authentication (MFA), and enforce strong password policies to ensure access to cloud-related services is protected.\n\n### Incident response\n\nOur internal protocol for handling security events includes detection, analysis, response, escalation, and mitigation. Security advisories are made available at [https://streamlit.io/advisories](https://streamlit.io/advisories).\n\n### Penetration testing\n\nStreamlit uses third-party security tools to scan for vulnerabilities on a regular basis. Our security teams conduct periodic, intensive penetration tests on the Streamlit platform. Our product development team responds to any identified issues or potential vulnerabilities to ensure the quality, security, and availability of Streamlit applications.\n\n### Vulnerability management\n\nWe keep our systems up-to-date with the latest security patches and continuously monitor for new vulnerabilities. This includes automated scanning of our code repositories for vulnerable dependencies.\n\nIf you discover a vulnerability in one of our products or websites, please report the issue to [HackerOne](https://hackerone.com/snowflake?type=team)." - }, - { - "url": "https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started", - "content": "# Get started with Streamlit Community Cloud\n\nWelcome to Streamlit Community Cloud, where you can share your Streamlit apps with the world! Whether you've already created your first Streamlit app or you're just getting started, you're in the right place.\n\nFirst things first, you need to create your Streamlit Community Cloud account to start deploying apps.\n\n\n \n \n\n\nIf you're looking for help to build your first Streamlit app, read our [Get started](/get-started) docs for the Streamlit library. If you want to fork an app and start with an example, check out our App gallery. Either way, it only takes a few minutes to create your first app.\n\nIf you're looking for more detailed instructions than the quickstart, try the following:\n\n\n See all the options and get complete explanations as you create your Streamlit Community Cloud account.\n After your create your Community Cloud account, connect GitHub for source control.\n Take a quick tour of your Community Cloud workspace. See where all the magic happens.\n Use a template to get your own app up and running in minutes.\n Start with a bang! Fork a public app and jump right into the code.\n" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/supported-browsers", - "content": "# What browsers does Streamlit support?\n\nThe latest version of Streamlit is compatible with the two most recent versions of the following browsers:\n\n- [Google Chrome](https://www.google.com/chrome/browser)\n- [Firefox](https://www.mozilla.org/en-US/firefox/new/)\n- [Microsoft Edge](https://www.microsoft.com/windows/microsoft-edge)\n- [Safari](https://www.apple.com/safari/)\n\n\n\nYou may not be able to use all the latest features of Streamlit with unsupported browsers or older versions of the above browsers. Streamlit will not provide bug fixes for unsupported browsers.\n\n" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/pydeck-chart-custom-mapbox-styles", - "content": "# How can I make st.pydeck_chart use custom Mapbox styles?\n\nIf 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](https://discuss.streamlit.io/t/deprecation-warning-deckgl-pydeck-maps-to-require-mapbox-token-for-production-usage/2982/10) for more information." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/sanity-checks", - "content": "# Sanity checks\n\nIf you're having problems running your Streamlit app, here are a few things to try out.\n\n## Check #0: Are you using a Streamlit-supported version of Python?\n\nStreamlit will maintain backwards-compatibility with earlier Python versions as practical,\nguaranteeing compatibility with _at least_ the last three minor versions of Python 3.\n\nAs new versions of Python are released, we will try to be compatible with the new version as soon\nas possible, though frequently we are at the mercy of other Python packages to support these new versions as well.\n\nStreamlit currently supports versions 3.9, 3.10, 3.11, 3.12, and 3.13 of Python.\n\n## Check #1: Is Streamlit running?\n\nOn a Mac or Linux machine, type this on the terminal:\n\n```bash\nps -Al | grep streamlit\n```\n\nIf you don't see `streamlit run` in the output (or `streamlit hello`, if that's\nthe command you ran) then the Streamlit server is not running. So re-run your command and see if the bug goes away.\n\n## Check #2: Is this an already-fixed Streamlit bug?\n\nWe try to fix bugs quickly, so many times a problem will go away when you\nupgrade Streamlit. So the first thing to try when having an issue is upgrading\nto the latest version of Streamlit:\n\n```bash\npip install --upgrade streamlit\nstreamlit version\n```\n\n...and then verify that the version number printed corresponds to the version number displayed on [PyPI](https://pypi.org/project/streamlit/).\n\n**Try reproducing the issue now.** If not fixed, keep reading on.\n\n## Check #3: Are you running the correct Streamlit binary?\n\nLet's check whether your Python environment is set up correctly. Edit the\nStreamlit script where you're experiencing your issue, **comment everything\nout, and add these lines instead:**\n\n```python\nimport streamlit as st\nst.write(st.__version__)\n```\n\n...then call `streamlit run` on your script and make sure it says the same\nversion as above. If not the same version, check out [these\ninstructions](/get-started/installation) for some sure-fire ways to set up your\nenvironment.\n\n## Check #4: Is your browser caching your app too aggressively?\n\nThere are two easy ways to check this:\n\n1. Load your app in a browser then press `Ctrl-Shift-R` or `⌘-Shift-R` to do a\n hard refresh (Chrome/Firefox).\n\n2. As a test, run Streamlit on another port. This way the browser starts the\n page with a brand new cache. For that, pass the `--server.port`\n argument to Streamlit on the command line:\n\n ```bash\n streamlit run my_app.py --server.port=9876\n ```\n\n## Check #5: Is this a Streamlit regression?\n\nIf you've upgraded to the latest version of Streamlit and things aren't\nworking, you can downgrade at any time using this command:\n\n```bash\npip install --upgrade streamlit==1.0.0\n```\n\n...where `1.0.0` is the version you'd like to downgrade to. See\n[Release notes](/develop/quick-reference/release-notes) for a complete list of Streamlit versions.\n\n## Check #6 [Windows]: Is Python added to your PATH?\n\nWhen installed by downloading from [python.org](https://www.python.org/downloads/), Python is\nnot automatically added to the [Windows system PATH](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access). Because of this, you may get error messages\nlike the following:\n\nCommand Prompt:\n\n```bash\nC:\\Users\\streamlit> streamlit hello\n'streamlit' is not recognized as an internal or external command,\noperable program or batch file.\n```\n\nPowerShell:\n\n```bash\nPS C:\\Users\\streamlit> streamlit hello\nstreamlit : The term 'streamlit' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that\nthe path is correct and try again.\nAt line:1 char:1\n+ streamlit hello\n+ ~~~~~~~~~\n + CategoryInfo : ObjectNotFound: (streamlit:String) [], CommandNotFoundException\n + FullyQualifiedErrorId : CommandNotFoundException\n```\n\nTo resolve this issue, add [Python to the Windows system PATH](https://datatofish.com/add-python-to-windows-path/).\n\nAfter adding Python to your Windows PATH, you should then be able to follow the instructions in our [Get Started](/get-started) section.\n\n## Check #7 [Windows]: Do you need Build Tools for Visual Studio installed?\n\nStreamlit includes [pyarrow](https://arrow.apache.org/docs/python/) as an install dependency. Occasionally, when trying to install Streamlit from PyPI, you may see errors such as the following:\n\n```bash\nUsing cached pyarrow-1.0.1.tar.gz (1.3 MB)\n Installing build dependencies ... error\n ERROR: Command errored out with exit status 1:\n command: 'c:\\users\\streamlit\\appdata\\local\\programs\\python\\python38-32\\python.exe' 'c:\\users\\streamlit\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pip' install --ignore-installed --no-user --prefix 'C:\\Users\\streamlit\\AppData\\Local\\Temp\\pip-build-env-s7owjrle\\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython >= 0.29' 'numpy==1.14.5; python_version<'\"'\"'3.9'\"'\"'' 'numpy==1.16.0; python_version>='\"'\"'3.9'\"'\"'' setuptools setuptools_scm wheel\n cwd: None\n\n Complete output (319 lines):\n\n Running setup.py install for numpy: finished with status 'error'\n ERROR: Command errored out with exit status 1:\n\n # #\n\n building library \"npymath\" sources\n No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils\n error: Microsoft Visual C++ 14.0 is required. Get it with \"Build Tools for Visual Studio\": https://visualstudio.microsoft.com/downloads/\n ----------------------------------------\n ERROR: Command errored out with exit status 1: 'c:\\users\\streamlit\\appdata\\local\\programs\\python\\python38-32\\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'C:\\\\Users\\\\streamlit\\\\AppData\\\\Local\\\\Temp\\\\pip-install-0jwfwx_u\\\\numpy\\\\setup.py'\"'\"'; __file__='\"'\"'C:\\\\Users\\\\streamlit\\\\AppData\\\\Local\\\\Temp\\\\pip-install-0jwfwx_u\\\\numpy\\\\setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' install --record 'C:\\Users\\streamlit\\AppData\\Local\\Temp\\pip-record-eys4l2gc\\install-record.txt' --single-version-externally-managed --prefix 'C:\\Users\\streamlit\\AppData\\Local\\Temp\\pip-build-env-s7owjrle\\overlay' --compile --install-headers 'C:\\Users\\streamlit\\AppData\\Local\\Temp\\pip-build-env-s7owjrle\\overlay\\Include\\numpy' Check the logs for full command output.\n ----------------------------------------\n```\n\nThis error indicates that Python is trying to compile certain libraries during install, but it cannot find the proper compilers on your system,\nas reflected by the line `error: Microsoft Visual C++ 14.0 is required. Get it with \"Build Tools for Visual Studio\"`.\n\nInstalling [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/) should resolve this issue." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/create-anchor-link", - "content": "# How do I create an anchor link?\n\n## Overview\n\nHave you wanted to create anchors so that users of your app can directly navigate to specific sections by specifying `#anchor` in the URL? If so, let's find out how.\n\n## Solution\n\nAnchors are automatically added to header text.\n\nFor example, if you define a header text via the [st.header()](/develop/api-reference/text/st.header) command as follows:\n\n```python\nst.header(\"Section 1\")\n```\n\nThen you can create a link to this header using:\n\n```python\nst.markdown(\"[Section 1](#section-1)\")\n```\n\n## Examples\n\n- Demo app: [https://dataprofessor-streamlit-anchor-app-80kk8w.streamlit.app/](https://dataprofessor-streamlit-anchor-app-80kk8w.streamlit.app/)\n- GitHub repo: [https://github.com/dataprofessor/streamlit/blob/main/anchor_app.py](https://github.com/dataprofessor/streamlit/blob/main/anchor_app.py)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/retrieve-filename-uploaded", - "content": "# How do you retrieve the filename of a file uploaded with st.file_uploader?\n\nIf you upload a single file (i.e. `accept_multiple_files=False`), the filename can be retrieved by using the `.name` attribute on the returned UploadedFile object:\n\n```python\nimport streamlit as st\n\nuploaded_file = st.file_uploader(\"Upload a file\")\n\nif uploaded_file:\n st.write(\"Filename: \", uploaded_file.name)\n```\n\nIf you upload multiple files (i.e. `accept_multiple_files=True`), the individual filenames can be retrieved by using the `.name` attribute on each UploadedFile object in the returned list:\n\n```python\nimport streamlit as st\n\nuploaded_files = st.file_uploader(\"Upload multiple files\", accept_multiple_files=True)\n\nif uploaded_files:\n for uploaded_file in uploaded_files:\n st.write(\"Filename: \", uploaded_file.name)\n```\n\nRelated forum posts:\n\n- https://discuss.streamlit.io/t/is-it-possible-to-get-uploaded-file-file-name/7586" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/how-download-file-streamlit", - "content": "# How to download a file in Streamlit?\n\nUse the [`st.download_button`](/develop/api-reference/widgets/st.download_button) widget that is natively built into Streamlit. Check out a [sample app](https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/) demonstrating how you can use `st.download_button` to download common file formats.\n\n## Example usage\n\n```python\nimport streamlit as st\n\n# Text files\n\ntext_contents = '''\nFoo, Bar\n123, 456\n789, 000\n'''\n\n# Different ways to use the API\n\nst.download_button('Download CSV', text_contents, 'text/csv')\nst.download_button('Download CSV', text_contents) # Defaults to 'text/plain'\n\nwith open('myfile.csv') as f:\n st.download_button('Download CSV', f) # Defaults to 'text/plain'\n\n# ---\n# Binary files\n\nbinary_contents = b'whatever'\n\n# Different ways to use the API\n\nst.download_button('Download file', binary_contents) # Defaults to 'application/octet-stream'\n\nwith open('myfile.zip', 'rb') as f:\n st.download_button('Download Zip', f, file_name='archive.zip') # Defaults to 'application/octet-stream'\n\n# You can also grab the return value of the button,\n# just like with any other button.\n\nif st.download_button(...):\n st.write('Thanks for downloading!')\n```\n\nAdditional resources:\n\n- [https://blog.streamlit.io/0-88-0-release-notes/](https://blog.streamlit.io/0-88-0-release-notes/)\n- [https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/](https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/)\n- [https://docs.streamlit.io/develop/api-reference/widgets/st.download_button](/develop/api-reference/widgets/st.download_button)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/why-streamlit-restrict-nested-columns", - "content": "# Why does Streamlit restrict nested `st.columns`?\n\nStarting in version 1.46.0, Streamlit removed explicit limits on nesting columns, expanders, popovers, and chat message containers. To follow best design practices and maintain a good appearance on all screen sizes, don't overuse nested layouts.\n\nFrom version 1.18.0 to 1.45.0, Streamlit allows nesting [`st.columns`](/develop/api-reference/layout/st.columns) inside other\n`st.columns` with the following restrictions:\n\n- In the main area of the app, columns can be nested up to one level of nesting.\n- In the sidebar, columns cannot be nested.\n\nThese restrictions were in place to make Streamlit apps look good on all device sizes. Nesting columns multiple times often leads to a bad UI.\nYou might be able to make it look good on one screen size but as soon as a user on a different screen views the app,\nthey will have a bad experience. Some columns will be tiny, others will be way too long, and complex layouts will look out of place.\nStreamlit tries its best to automatically resize elements to look good across devices, without any help from the developer.\nBut for complex layouts with multiple levels of nesting, this is not possible." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/serializable-session-state", - "content": "# What is serializable session state?\n\n## Serializable Session State\n\nSerialization refers to the process of converting an object or data structure into a format that can be persisted and shared, and allowing you to recover the data’s original structure. Python’s built-in [pickle](https://docs.python.org/3/library/pickle.html) module serializes Python objects to a byte stream (\"pickling\") and deserializes the stream into an object (\"unpickling\").\n\nBy default, Streamlit’s [Session State](/develop/concepts/architecture/session-state) allows you to persist any Python object for the duration of the session, irrespective of the object’s pickle-serializability. This property lets you store Python primitives such as integers, floating-point numbers, complex numbers and booleans, dataframes, and even [lambdas](https://docs.python.org/3/reference/expressions.html#lambda) returned by functions. However, some execution environments may require serializing all data in Session State, so it may be useful to detect incompatibility during development, or when the execution environment will stop supporting it in the future.\n\nTo that end, Streamlit provides a `runner.enforceSerializableSessionState` [configuration option](/develop/concepts/configuration) that, when set to `true`, only allows pickle-serializable objects in Session State. To enable the option, either create a global or project config file with the following or use it as a command-line flag:\n\n```toml\n# .streamlit/config.toml\n[runner]\nenforceSerializableSessionState = true\n```\n\nBy \"_pickle-serializable_\", we mean calling `pickle.dumps(obj)` should not raise a [`PicklingError`](https://docs.python.org/3/library/pickle.html#pickle.PicklingError) exception. When the config option is enabled, adding unserializable data to session state should result in an exception. E.g.,\n\n```python\nimport streamlit as st\n\ndef unserializable_data():\n\t\treturn lambda x: x\n\n#👇 results in an exception when enforceSerializableSessionState is on\nst.session_state.unserializable = unserializable_data()\n```\n\n\"UnserializableSessionStateError\"" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/where-file-uploader-store-when-deleted", - "content": "# Where does st.file_uploader store uploaded files and when do they get deleted?\n\nWhen you upload a file using [`st.file_uploader`](/develop/api-reference/widgets/st.file_uploader), the data are copied to the Streamlit backend via the browser, and contained in a BytesIO buffer in Python memory (i.e. RAM, not disk). The data will persist in RAM until the Streamlit app re-runs from top-to-bottom, which is on each widget interaction. If you need to save the data that was uploaded between runs, then you can [cache](/develop/concepts/architecture/caching) it so that Streamlit persists it across re-runs.\n\nAs files are stored in memory, they get deleted immediately as soon as they’re not needed anymore.\n\nThis means Streamlit removes a file from memory when:\n\n- The user uploads another file, replacing the original one\n- The user clears the file uploader\n- The user closes the browser tab where they uploaded the file\n\nRelated forum posts:\n\n- https://discuss.streamlit.io/t/streamlit-sharing-fileupload-where-does-it-go/9267\n- https://discuss.streamlit.io/t/how-to-update-the-uploaded-file-using-file-uploader/13512/" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/how-upgrade-latest-version-streamlit", - "content": "# How do I upgrade to the latest version of Streamlit?\n\nWe recommend upgrading to the latest official release of Streamlit so you have access to the newest, cutting-edge features. If you haven't installed Streamlit yet, please read our [Installation guide](/get-started/installation). It helps you set up your virtual environment and walks you through installing Streamlit on Windows, macOS, and Linux. Regardless of which package management tool and OS you're using, we recommend running the commands on this page in a virtual environment.\n\nIf you've previously installed Streamlit and want to upgrade to the latest version, here's how to do it based on your dependency manager.\n\n## Pipenv\n\nStreamlit's officially-supported environment manager for macOS and Linux is [Pipenv](https://pypi.org/project/pipenv/).\n\n1. Navigate to the project folder containing your Pipenv environment:\n\n```bash\ncd myproject\n```\n\n2. Activate that environment, upgrade Streamlit, and verify you have the latest version:\n\n```bash\npipenv shell\npip install --upgrade streamlit\nstreamlit version\n```\n\nOr if you want to use an easily-reproducible environment, replace `pip` with `pipenv`every time you install or update a package:\n\n```bash\npipenv update streamlit\npipenv run streamlit version\n```\n\n## Conda\n\n1. Activate the conda environment where Streamlit is installed:\n\n```bash\nconda activate $ENVIRONMENT_NAME\n```\n\nBe sure to replace`$ENVIRONMENT_NAME` ☝️ with the name your conda environment!\n\n2. Update Streamlit within the active conda environment and verify you have the latest version:\n\n```bash\nconda update -c conda-forge streamlit -y\nstreamlit version\n```\n\n## Poetry\n\nIn order to get the latest version of Streamlit with [Poetry](https://python-poetry.org/) and verify you have the latest version, run:\n\n```bash\npoetry update streamlit\nstreamlit version\n```" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/enable-camera", - "content": "# Enabling camera or microphone access in your browser\n\nStreamlit apps may include a widget to upload images from your camera or record sound with your microphone. To\nsafeguard the users' privacy and security, browsers require users to explicitly allow access to their\ncamera or microphone before those devices can be used.\n\nTo learn how to enable camera access, please check the documentation for your browser:\n\n- [Chrome](https://support.google.com/chrome/answer/2693767)\n- [Safari](https://support.apple.com/guide/safari/websites-ibrwe2159f50/mac)\n- [Firefox](https://support.mozilla.org/en-US/kb/how-manage-your-camera-and-microphone-permissions)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/widget-updating-session-state", - "content": "# Widget updating for every second input when using session state\n\n## Overview\n\nYou are using [session state](/develop/api-reference/caching-and-state/st.session_state) to store page interactions in your app. When users interact with a widget in your app (e.g., click a button), you expect your app to update its widget states and reflect the new values. However, you notice that it doesn't. Instead, users have to interact with the widget twice (e.g., click a button twice) for the app to show the correct values. What do you do now? 🤔 Let's walk through the solution in the section below.\n\n## Solution\n\nWhen using session state to update widgets or values in your script, you need to use the unique key you assigned to the widget, **not** the variable that you assigned your widget to. In the example code block below, the unique _key_ assigned to the slider widget is `slider`, and the _variable_ the widget is assigned to is `slide_val`.\n\nLet's see this in an example. Say you want a user to click a button that resets a slider.\n\nTo have the slider's value update on the button click, you need to use a [callback function](/develop/api-reference/caching-and-state/st.session_state#use-callbacks-to-update-session-state) with the `on_click` parameter of [`st.button`](/develop/api-reference/widgets/st.button):\n\n```python\n# the callback function for the button will add 1 to the\n# slider value up to 10\ndef plus_one():\n if st.session_state[\"slider\"] < 10:\n st.session_state.slider += 1\n else:\n pass\n return\n\n# when creating the button, assign the name of your callback\n# function to the on_click parameter\nadd_one = st.button(\"Add one to the slider\", on_click=plus_one, key=\"add_one\")\n\n# create the slider\nslide_val = st.slider(\"Pick a number\", 0, 10, key=\"slider\")\n```\n\n## Relevant resources\n\n- [Caching Sqlite DB connection resulting in glitchy rendering of the page](https://discuss.streamlit.io/t/caching-sqlite-db-connection-resulting-in-glitchy-rendering-of-the-page/19017)\n- [Select all checkbox that is linked to selectbox of options](https://discuss.streamlit.io/t/select-all-checkbox-that-is-linked-to-selectbox-of-options/18521)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/insert-elements-out-of-order", - "content": "# How to insert elements out of order?\n\nYou can use the [`st.empty`](/develop/api-reference/layout/st.empty) method as a placeholder,\nto \"save\" a slot in your app that you can use later.\n\n```python\nst.text('This will appear first')\n# Appends some text to the app.\n\nmy_slot1 = st.empty()\n# Appends an empty slot to the app. We'll use this later.\n\nmy_slot2 = st.empty()\n# Appends another empty slot.\n\nst.text('This will appear last')\n# Appends some more text to the app.\n\nmy_slot1.text('This will appear second')\n# Replaces the first empty slot with a text string.\n\nmy_slot2.line_chart(np.random.randn(20, 2))\n# Replaces the second empty slot with a chart.\n```" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/how-download-pandas-dataframe-csv", - "content": "# How to download a Pandas DataFrame as a CSV?\n\nUse the [`st.download_button`](/develop/api-reference/widgets/st.download_button) widget that is natively built into Streamlit. Check out a [sample app](https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/) demonstrating how you can use `st.download_button` to download common file formats.\n\n## Example usage\n\n```python\nimport streamlit as st\nimport pandas as pd\n\ndf = pd.read_csv(\"dir/file.csv\")\n\n@st.cache_data\ndef convert_df(df):\n return df.to_csv(index=False).encode('utf-8')\n\n\ncsv = convert_df(df)\n\nst.download_button(\n \"Press to Download\",\n csv,\n \"file.csv\",\n \"text/csv\",\n key='download-csv'\n)\n```\n\nAdditional resources:\n\n- [https://blog.streamlit.io/0-88-0-release-notes/](https://blog.streamlit.io/0-88-0-release-notes/)\n- [https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/](https://streamlit-release-demos-0-88streamlit-app-0-88-v8ram3.streamlit.app/)\n- [https://docs.streamlit.io/develop/api-reference/widgets/st.download_button](/develop/api-reference/widgets/st.download_button)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/remove-streamlit-app-title", - "content": "# How to remove \"· Streamlit\" from the app title?\n\nUsing [`st.set_page_config`](/develop/api-reference/configuration/st.set_page_config) to assign the page title will not append \"· Streamlit\" to that title. E.g.:\n\n```python\nimport streamlit as st\n\nst.set_page_config(\n page_title=\"Ex-stream-ly Cool App\",\n page_icon=\"🧊\",\n layout=\"wide\",\n initial_sidebar_state=\"expanded\",\n)\n```" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit", - "content": "# FAQ\n\nHere are some frequently asked questions about using Streamlit. If you feel something important is missing that everyone needs to know, please [open an issue](https://github.com/streamlit/docs/issues) or [submit a pull request](https://github.com/streamlit/docs/pulls) and we'll be happy to review it!\n\n- [Sanity checks](/knowledge-base/using-streamlit/sanity-checks)\n- [How can I make Streamlit watch for changes in other modules I'm importing in my app?](/knowledge-base/using-streamlit/streamlit-watch-changes-other-modules-importing-app)\n- [What browsers does Streamlit support?](/knowledge-base/using-streamlit/supported-browsers)\n- [Where does st.file_uploader store uploaded files and when do they get deleted?](/knowledge-base/using-streamlit/where-file-uploader-store-when-deleted)\n- [How do you retrieve the filename of a file uploaded with st.file_uploader?](/knowledge-base/using-streamlit/retrieve-filename-uploaded)\n- [How to remove \"· Streamlit\" from the app title?](/knowledge-base/using-streamlit/remove-streamlit-app-title)\n- [How to download a file in Streamlit?](/knowledge-base/using-streamlit/how-download-file-streamlit)\n- [How to download a Pandas DataFrame as a CSV?](/knowledge-base/using-streamlit/how-download-pandas-dataframe-csv)\n- [How can I make `st.pydeck_chart` use custom Mapbox styles?](/knowledge-base/using-streamlit/pydeck-chart-custom-mapbox-styles)\n- [How to insert elements out of order?](/knowledge-base/using-streamlit/insert-elements-out-of-order)\n- [How do I upgrade to the latest version of Streamlit?](/knowledge-base/using-streamlit/how-upgrade-latest-version-streamlit)\n- [Widget updating for every second input when using session state](/knowledge-base/using-streamlit/widget-updating-session-state)\n- [How do I create an anchor link?](/knowledge-base/using-streamlit/create-anchor-link)\n- [How do I enable camera access?](/knowledge-base/using-streamlit/enable-camera)\n- [Why does Streamlit restrict nested `st.columns`?](/knowledge-base/using-streamlit/why-streamlit-restrict-nested-columns)\n- [What is serializable session state?](/knowledge-base/using-streamlit/serializable-session-state)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/using-streamlit/streamlit-watch-changes-other-modules-importing-app", - "content": "# How can I make Streamlit watch for changes in other modules I'm importing in my app?\n\nBy default, Streamlit only watches modules contained in the current directory of the main app module. You can track other modules by adding the parent directory of each module to the `PYTHONPATH`.\n\n```bash\nexport PYTHONPATH=$PYTHONPATH:/path/to/module\nstreamlit run your_script.py\n```" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/dependencies/install-package-not-pypi-conda-available-github", - "content": "# How to install a package not on PyPI/Conda but available on GitHub\n\n## Overview\n\nAre you trying to deploy your app to [Streamlit Community Cloud](/deploy/streamlit-community-cloud), but don't know how to specify a [Python dependency](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) in your requirements file that is available on a public GitHub repo but not any package index like PyPI or Conda? If so, continue reading to find out how!\n\nLet's suppose you want to install `SomePackage` and its Python dependencies from GitHub, a hosting service for the popular version control system (VCS) Git. And suppose `SomePackage` is found at the the following URL: `https://github.com/SomePackage.git`.\n\npip (via `requirements.txt`) [supports](https://pip.pypa.io/en/stable/topics/vcs-support/) installing from GitHub. This support requires a working executable to be available (for Git). It is used through a URL prefix: `git+`.\n\n## Specify the GitHub web URL\n\nTo install `SomePackage`, innclude the following in your `requirements.txt` file:\n\n```bash\ngit+https://github.com/SomePackage#egg=SomePackage\n```\n\nYou can even specify a \"git ref\" such as branch name, a commit hash or a tag name, as shown in the examples below.\n\n## Specify a Git branch name\n\nInstall `SomePackage` by specifying a branch name such as `main`, `master`, `develop`, etc, in `requirements.txt`:\n\n```bash\ngit+https://github.com/SomePackage.git@main#egg=SomePackage\n```\n\n## Specify a commit hash\n\nInstall `SomePackage` by specifying a commit hash in `requirements.txt`:\n\n```bash\ngit+https://github.com/SomePackage.git@eb40b4ff6f7c5c1e4366cgfg0671291bge918#egg=SomePackage\n```\n\n## Specify a tag\n\nInstall `SomePackage` by specifying a tag in `requirements.txt`:\n\n```bash\ngit+https://github.com/SomePackage.git@v1.1.0#egg=SomePackage\n```\n\n## Limitations\n\nIt is currently **not possible** to install private packages from private GitHub repos using the URI form:\n\n```bash\ngit+https://{token}@github.com/user/project.git@{version}\n```\n\nwhere `version` is a tag, a branch, or a commit. And `token` is a personal access token with read only permissions. Streamlit Community Cloud only supports installing public packages from public GitHub repos." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/dependencies/module-not-found-error", - "content": "# ModuleNotFoundError: No module named\n\n## Problem\n\nYou receive the error `ModuleNotFoundError: No module named` when you deploy an app on [Streamlit Community Cloud](https://streamlit.io/cloud).\n\n## Solution\n\nThis error occurs when you import a module on Streamlit Community Cloud that isn’t included in your requirements file. Any external [Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) that are not distributed with a [standard Python installation](https://docs.python.org/3/py-modindex.html) should be included in your requirements file.\n\nE.g. You will see `ModuleNotFoundError: No module named 'sklearn'` if you don’t include `scikit-learn` in your requirements file and `import sklearn` in your app.\n\nRelated forum posts:\n\n- https://discuss.streamlit.io/t/getting-error-modulenotfounderror-no-module-named-beautifulsoup/9126\n- https://discuss.streamlit.io/t/modulenotfounderror-no-module-named-vega-datasets/16354" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/dependencies/no-matching-distribution", - "content": "# ERROR: No matching distribution found for\n\n## Problem\n\nYou receive the error `ERROR: No matching distribution found for` when you deploy an app on [Streamlit Community Cloud](https://streamlit.io/cloud).\n\n## Solution\n\nThis error occurs when you deploy an app on Streamlit Community Cloud and have one or more of the following issues with your [Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) in your requirements file:\n\n1. The package is part of the [Python Standard Library](https://docs.python.org/3/py-modindex.html). E.g. You will see **`ERROR: No matching distribution found for base64`** if you include [`base64`](https://docs.python.org/3/library/base64.html) 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.\n2. The package name in your requirements file is misspelled. Double-check the package name before including it in your requirements file.\n3. 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.\n\nRelated forum posts:\n\n- https://discuss.streamlit.io/t/error-no-matching-distribution-found-for-base64/15758\n- https://discuss.streamlit.io/t/error-could-not-find-a-version-that-satisfies-the-requirement-pywin32-301-from-versions-none/15343/2" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/dependencies/libgl", - "content": "# ImportError libGL.so.1 cannot open shared object file No such file or directory\n\n## Problem\n\nYou receive the error `ImportError libGL.so.1 cannot open shared object file No such file or directory` when using OpenCV in your app deployed on [Streamlit Community Cloud](https://streamlit.io/cloud).\n\n## Solution\n\nIf you use OpenCV in your app, include `opencv-python-headless` in your requirements file on Streamlit Community Cloud in place of `opencv_contrib_python` and `opencv-python`.\n\nIf `opencv-python` is a _required_ (non-optional) dependency of your app or a dependency of a library used in your app, the above solution is not applicable. Instead, you can use the following solution:\n\nCreate a `packages.txt` file in your repo with the following line to install the [apt-get dependency](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#apt-get-dependencies) `libgl`:\n\n```\nlibgl1\n```" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/dependencies", - "content": "# Installing dependencies\n\n- [ModuleNotFoundError: No module named](/knowledge-base/dependencies/module-not-found-error)\n- [ImportError: libGL.so.1: cannot open shared object file: No such file or directory](/knowledge-base/dependencies/libgl)\n- [ERROR: No matching distribution found for](/knowledge-base/dependencies/no-matching-distribution)\n- [How to install a package not on PyPI/Conda but available on GitHub](/knowledge-base/dependencies/install-package-not-pypi-conda-available-github)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/login-attempt-to-streamlit-community-cloud-fails-with-error-403", - "content": "# Login attempt to Streamlit Community Cloud fails with error 403\n\n## Problem\n\nStreamlit Community Cloud has monitoring jobs to detect malicious users using the platform for crypto mining. These jobs sometimes result in false positives and a normal user starts getting error 403 against a login attempt.\n\n## Solution\n\nPlease contact [Support](mailto:support@streamlit.io) by providing your **GitHub username** for help referring to this article." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/does-streamlit-support-wsgi-protocol", - "content": "# Does Streamlit support the WSGI Protocol? (aka Can I deploy Streamlit with gunicorn?)\n\n## Problem\n\nYou're not sure whether your Streamlit app can be deployed with gunicorn.\n\n## Solution\n\nStreamlit does not support the WSGI protocol at this time, so deploying Streamlit with (for example) gunicorn is not currently possible. Check out this [forum thread regarding deploying Streamlit in a gunicorn-like manner](https://discuss.streamlit.io/t/how-do-i-set-the-server-to-0-0-0-0-for-deployment-using-docker/216) to see how other users have accomplished this." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/invoking-python-subprocess-deployed-streamlit-app", - "content": "# Invoking a Python subprocess in a deployed Streamlit app\n\n## Problem\n\nLet's suppose you want to invoke a subprocess to run a Python script `script.py` in your deployed Streamlit app `streamlit_app.py`. For example, the machine learning library [Ludwig](https://ludwig-ai.github.io/ludwig-docs/) is run using a command-line interface, or maybe you want to run a bash script or similar type of process from Python.\n\nYou have tried the following, but run into dependency issues for `script.py`, even though you have specified your Python dependencies in a requirements file:\n\n```python\n# streamlit_app.py\nimport streamlit as st\nimport subprocess\n\nsubprocess.run([\"python\", \"script.py\"])\n```\n\n## Solution\n\nWhen you run the above code block, you will get the version of Python that is on the system path—not necessarily the Python executable installed in the virtual environment that the Streamlit code is running under.\n\nThe solution is to detect the Python executable directly with [`sys.executable`](https://docs.python.org/3/library/sys.html#sys.executable):\n\n```python\n# streamlit_app.py\nimport streamlit as st\nimport subprocess\nimport sys\n\nsubprocess.run([f\"{sys.executable}\", \"script.py\"])\n```\n\nThis ensures that `script.py` is running under the same Python executable as your Streamlit code—where your [Python dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#add-python-dependencies) are installed.\n\n### Relevant links\n\n- https://stackoverflow.com/questions/69947867/run-portion-of-python-code-in-parallel-from-a-streamlit-app/69948545#69948545\n- https://discuss.streamlit.io/t/modulenotfounderror-no-module-named-cv2-streamlit/18319/3?u=snehankekre\n- https://docs.python.org/3/library/sys.html#sys.executable" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/deploy-multiple-streamlit-apps-different-subdomains", - "content": "# How can I deploy multiple Streamlit apps on different subdomains?\n\n## Problem\n\nYou want to deploy multiple Streamlit apps on different subdomains.\n\n## Solution\n\nLike running your Streamlit app on more common ports such as 80, subdomains are handled by a web server like Apache or Nginx:\n\n- Set up a web server on a machine with a public IP address, then use a DNS server to point all desired subdomains to your webserver's IP address\n\n- Configure your web server to route requests for each subdomain to the different ports that your Streamlit apps are running on\n\nFor example, let’s say you had two Streamlit apps called `Calvin` and `Hobbes`. App `Calvin` is running on port **8501**. You set up app `Hobbes` to run on port **8502**. Your webserver would then be set up to \"listen\" for requests on subdomains `calvin.somedomain.com` and `hobbes.subdomain.com`, and route requests to port **8501** and **8502**, respectively.\n\nCheck out these two tutorials for Apache2 and Nginx that deal with setting up a webserver to redirect subdomains to different ports:\n\n- [Apache2 subdomains](https://stackoverflow.com/questions/8541182/apache-redirect-to-another-port)\n- [NGinx subdomains](https://gist.github.com/soheilhy/8b94347ff8336d971ad0)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/resource-limits", - "content": "# Argh. This app has gone over its resource limits\n\nSorry! It means you've hit the [resource limits](/deploy/streamlit-community-cloud/manage-your-app#app-resources-and-limits) of your [Streamlit Community Cloud](https://streamlit.io/cloud) account.\n\nThere are a few things you can change in your app to make it less resource-hungry:\n\n- Reboot your app (temporary fix)\n- Use `st.cache_data` or `st.cache_resource` to load models or data only once\n- Restrict the cache size with `ttl` or `max_entries`\n- Move big datasets to a database\n- Profile your app's memory usage\n\nCheck out our [blog post](https://blog.streamlit.io/common-app-problems-resource-limits/) on [\"Common app problems: Resource limits\"](https://blog.streamlit.io/common-app-problems-resource-limits/) for more in-depth tips prevent your app from hitting the [resource limits](/deploy/streamlit-community-cloud/manage-your-app#app-resources-and-limits) of the Streamlit Community Cloud.\n\nRelated forum posts:\n\n- [https://discuss.streamlit.io/t/common-app-problems-resource-limits/16969](https://discuss.streamlit.io/t/common-app-problems-resource-limits/16969)\n- [https://blog.streamlit.io/common-app-problems-resource-limits/](https://blog.streamlit.io/common-app-problems-resource-limits/)\n\nWe offer free resource increases only to support nonprofits or educational organizations on a case-by-case basis. If you are a nonprofit or educational organization, please complete [this form](https://info.snowflake.com/streamlit-resource-increase-request.html) and we will review your submission as soon as possible.\n\nOnce the increase is completed, you will receive an email from the Streamlit marketing team with a confirmation that the increase has been applied." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/increase-file-uploader-limit-streamlit-cloud", - "content": "# How do I increase the upload limit of st.file_uploader on Streamlit Community Cloud?\n\n## Overview\n\nBy default, files uploaded using [`st.file_uploader()`](/develop/api-reference/widgets/st.file_uploader) are limited to 200MB. You can configure this using the `server.maxUploadSize` config option.\n\nStreamlit provides [four different ways to set configuration options](/develop/concepts/configuration):\n\n1. In a **global config file** at `~/.streamlit/config.toml` for macOS/Linux or `%userprofile%/.streamlit/config.toml` for Windows:\n ```toml\n [server]\n maxUploadSize = 200\n ```\n2. In a **per-project config file** at `$CWD/.streamlit/config.toml`, where `$CWD` is the folder you're running Streamlit from.\n3. Through `STREAMLIT_*` **environment variables**, such as:\n ```bash\n export STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200\n ```\n4. As **flags on the command line** when running `streamlit run`:\n ```bash\n streamlit run your_script.py --server.maxUploadSize 200\n ```\n\nWhich of the four options should you choose for an app deployed to [Streamlit Community Cloud](/deploy/streamlit-community-cloud)? 🤔\n\n## Solution\n\nWhen deploying your app to Streamlit Community Cloud, you should **use option 1**. Namely, set the `maxUploadSize` config option in a global config file (`.streamlit/config.toml`) uploaded to your app's GitHub repo. 🎈\n\nFor example, to increase the upload limit to 400MB, upload a `.streamlit/config.toml` file containing the following lines to your app's GitHub repo:\n\n```toml\n[server]\nmaxUploadSize = 400\n```\n\n## Relevant resources\n\n- [Streamlit drag and drop capping at 200MB, need workaround](https://discuss.streamlit.io/t/streamlit-drag-and-drop-capping-at-200mb-need-workaround/19803/2)\n- [File uploader widget API](/develop/api-reference/widgets/st.file_uploader)\n- [How to set Streamlit configuration options](/develop/concepts/configuration)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/remote-start", - "content": "# App is not loading when running remotely\n\nBelow are a few common errors that occur when users spin up their own solution\nto host a Streamlit app remotely.\n\nTo learn about a deceptively simple way to host Streamlit apps that avoids all\nthe issues below, check out [Streamlit Community Cloud](https://streamlit.io/cloud).\n\n### Symptom #1: The app never loads\n\nWhen you enter the app's URL in a browser and all you see is a **blank page, a\n\"Page not found\" error, a \"Connection refused\" error**, or anything like that,\nfirst check that Streamlit is actually running on the remote server. On a Linux\nserver you can SSH into it and then run:\n\n```bash\nps -Al | grep streamlit\n```\n\nIf you see Streamlit running, the most likely culprit is the Streamlit port not\nbeing exposed. The fix depends on your exact setup. Below are three example\nfixes:\n\n- **Try port 80:** Some hosts expose port 80 by default. To\n set Streamlit to use that port, start Streamlit with the `--server.port`\n option:\n\n ```bash\n streamlit run my_app.py --server.port=80\n ```\n\n- **AWS EC2 server**: First, click on your instance in the [AWS Console](https://us-west-2.console.aws.amazon.com/ec2/v2/home).\n Then scroll down and click on _Security Groups_ → _Inbound_ → _Edit_. Next, add\n a _Custom TCP_ rule that allows the _Port Range_ `8501` with _Source_\n `0.0.0.0/0`.\n\n- **Other types of server**: Check the firewall settings.\n\nIf that still doesn't solve the problem, try running a simple HTTP server\ninstead of Streamlit, and seeing if _that_ works correctly. If it does, then\nyou know the problem lies somewhere in your Streamlit app or configuration (in\nwhich case you should ask for help in our\n[forums](https://discuss.streamlit.io)!) If not, then it's definitely unrelated\nto Streamlit.\n\nHow to start a simple HTTP server:\n\n```bash\npython -m http.server [port]\n```\n\n### Symptom #2: The app says \"Please wait...\" or shows skeleton elements forever\n\nThis symptom appears differently starting from version 1.29.0. For earlier\nversions of Streamlit, a loading app shows a blue box in the center of the page\nwith a \"Please wait...\" message. Starting from version 1.29.0, a loading app\nshows skeleton elements. If this loading screen does not go away, the\nunderlying cause is likely one of the following:\n\n- Using port 3000 which is reserved for internal development.\n- Misconfigured [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)\n protection.\n- Server is stripping headers from the Websocket connection, thereby breaking\n compression.\n\nTo diagnose the issue, first make sure you are not using port 3000. If in doubt,\ntry port 80 as described above.\n\nNext, try temporarily disabling CORS protection by running Streamlit with the\n`--server.enableCORS` flag set to `false`:\n\n```bash\nstreamlit run my_app.py --server.enableCORS=false\n```\n\nIf this fixes your issue, **you should re-enable CORS protection** and then set\n`browser.serverAddress` to the URL of your Streamlit app.\n\nIf the issue persists, try disabling websocket compression by running Streamlit with the\n`--server.enableWebsocketCompression` flag set to `false`\n\n```bash\nstreamlit run my_app.py --server.enableWebsocketCompression=false\n```\n\nIf this fixes your issue, your server setup is likely stripping the\n`Sec-WebSocket-Extensions` HTTP header that is used to negotiate Websocket compression.\n\nCompression is not required for Streamlit to work, but it's strongly recommended as it\nimproves performance. If you'd like to turn it back on, you'll need to find which part\nof your infrastructure is stripping the `Sec-WebSocket-Extensions` HTTP header and\nchange that behavior.\n\n### Symptom #3: Unable to upload files when running in multiple replicas\n\nIf the file uploader widget returns an error with status code 403, this is probably\ndue to a misconfiguration in your app's\n[XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) protection logic.\n\nTo diagnose the issue, try temporarily disabling XSRF protection by running Streamlit\nwith the `--server.enableXsrfProtection` flag set to `false`:\n\n```bash\nstreamlit run my_app.py --server.enableXsrfProtection=false\n```\n\nIf this fixes your issue, **you should re-enable XSRF protection** and try one\nor both of the following:\n\n- Set `browser.serverAddress` and `browser.serverPort` to the URL and port of\n your Streamlit app.\n- Configure your app to use the same secret across every replica by setting the\n `server.cookieSecret` config option to the same hard-to-guess string everywhere." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/huh-this-isnt-supposed-to-happen-message-after-trying-to-log-in", - "content": "# Huh. This is isn't supposed to happen message after trying to log in\n\nThis article helps to resolve the login issue caused by email mismatching between the GitHub and the Streamlit Community Cloud.\n\n## Problem\n\nYou see the following message after signing in to your Streamlit Community Cloud account:\n\n![Huh. This is isn't supposed to happen message](/images/knowledge-base/huh-this-isnt-supposed-to-happen.png)\n\nThis message usually indicates that our system has linked your GitHub username with an email address other than the email address you're currently logged in with.\n\n## Solution\n\nNo worries – all you have to do is:\n\n1. Log out of Streamlit Community Cloud completely (via both your email and GitHub accounts).\n2. Log in first with your email account (you can do so via either [\"Continue with Google\"](/deploy/streamlit-community-cloud/manage-your-account/sign-in-sign-out#sign-in-with-google) or [\"Continue with email\"](/knowledge-base/deploy/sign-in-without-sso)).\n3. Log in with your [GitHub account](/deploy/streamlit-community-cloud/manage-your-account/sign-in-sign-out#sign-in-with-email)." - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy", - "content": "# Deployment-related questions and errors\n\n- [How do I deploy Streamlit on a domain so it appears to run on a regular port (i.e. port 80)?](/knowledge-base/deploy/deploy-streamlit-domain-port-80)\n- [How can I deploy multiple Streamlit apps on different subdomains?](/knowledge-base/deploy/deploy-multiple-streamlit-apps-different-subdomains)\n- [Invoking a Python subprocess in a deployed Streamlit app](/knowledge-base/deploy/invoking-python-subprocess-deployed-streamlit-app)\n- [Does Streamlit support the WSGI Protocol? (aka Can I deploy Streamlit with gunicorn?)](/knowledge-base/deploy/does-streamlit-support-wsgi-protocol)\n- [Argh. This app has gone over its resource limits.](/knowledge-base/deploy/resource-limits)\n- [App is not loading when running remotely](/knowledge-base/deploy/remote-start)\n- [Authentication without SSO](/knowledge-base/deploy/authentication-without-sso)\n- [How do I increase the upload limit of `st.file_uploader` on Streamlit Community Cloud?](/knowledge-base/deploy/increase-file-uploader-limit-streamlit-cloud)\n- [Huh. This is isn't supposed to happen message after trying to log in](/knowledge-base/deploy/huh-this-isnt-supposed-to-happen-message-after-trying-to-log-in)\n- [Login attempt to Streamlit Community Cloud fails with error 403](/knowledge-base/deploy/login-attempt-to-streamlit-community-cloud-fails-with-error-403)\n- [How to submit a support case for Streamlit Community Cloud](/knowledge-base/deploy/how-to-submit-a-support-case-for-streamlit-community-cloud)" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/deploy-streamlit-domain-port-80", - "content": "# How do I deploy Streamlit on a domain so it appears to run on a regular port (i.e. port 80)?\n\n## Problem\n\nYou want to deploy a Streamlit app on a domain so it appears to run on port 80.\n\n## Solution\n\n- You should use a **reverse proxy** to forward requests from a webserver like [Apache](https://httpd.apache.org/) or [Nginx](https://www.nginx.com/) to the port where your Streamlit app is running. You can accomplish this in several different ways. The simplest way is to [forward all requests sent to your domain](https://discuss.streamlit.io/t/permission-denied-in-ec2-port-80/798/3) so that your Streamlit app appears as the content of your website.\n\n- Another approach is to configure your webserver to forward requests to designated subfolders (e.g. _http://awesomestuff.net/streamlitapp_) to different Streamlit apps on the same domain, as in this [example config for Nginx](https://discuss.streamlit.io/t/how-to-use-streamlit-with-nginx/378/7) submitted by a Streamlit community member.\n\nRelated forum posts:\n\n- https://discuss.streamlit.io/t/permission-denied-in-ec2-port-80/798/3\n- https://discuss.streamlit.io/t/how-to-use-streamlit-with-nginx/378/7" - }, - { - "url": "https://docs.streamlit.io/knowledge-base/deploy/how-to-submit-a-support-case-for-streamlit-community-cloud", - "content": "# How to submit a support case for Streamlit Community Cloud\n\nThis article describes the steps to submit a support request to Snowflake for Streamlit Community Cloud.\n\n\n\nFor Snowflake customers, a support case can be submitted via [the support portal on Snowsight](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge#Option1).\n\n\n\n1. Navigate to [https://community.snowflake.com/s/](https://community.snowflake.com/s/) in your browser.\n1. If you already have a Snowflake Community account, sign in. Otherwise, click \"**CREATE ACCOUNT**,\" and follow the prompts.\n1. At the top of the page, click \"**SUPPORT**.\"\n1. From the drop-down menu, select \"**Submit A Case**.\"\n1. Select the option \"**I am a Streamlit Community Cloud user**.\"\n1. Click \"**Next**\" to open the case description page.\n1. Fill out your request and submit the support case.\n\nYou should receive a confirmation email with the case number. A Snowflake Support engineer will follow up directly with the next steps to resolve your case. All communication will be through email." - }, - { - "url": "https://docs.streamlit.io/develop/api-reference", - "content": "# API reference\n\nStreamlit makes it easy for you to visualize, mutate, and share data. The API\nreference is organized by activity type, like displaying data or optimizing\nperformance. Each section includes methods associated with the activity type,\nincluding examples.\n\nBrowse our API below and click to learn more about any of our available commands! 🎈\n\n## Display almost anything\n\n### Write and magic\n\n
\n\n\n\n\n\n

st.write

\n\nWrite arguments to the app.\n\n```python\nst.write(\"Hello **world**!\")\nst.write(my_data_frame)\nst.write(my_mpl_figure)\n```\n\n
\n\n\n

st.write_stream

\n\nWrite generators or streams to the app with a typewriter effect.\n\n```python\nst.write_stream(my_generator)\nst.write_stream(my_llm_stream)\n```\n\n
\n\n\n

Magic

\n\nAny time Streamlit sees either a variable or literal value on its own line, it automatically writes that to your app using `st.write`\n\n```python\n\"Hello **world**!\"\nmy_data_frame\nmy_mpl_figure\n```\n\n
\n
\n\n### Text elements\n\n
\n\n\n\n\n\"screenshot\"\n\n

Markdown

\n\nDisplay string formatted as Markdown.\n\n```python\nst.markdown(\"Hello **world**!\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Title

\n\nDisplay text in title formatting.\n\n```python\nst.title(\"The app title\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Header

\n\nDisplay text in header formatting.\n\n```python\nst.header(\"This is a header\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Subheader

\n\nDisplay text in subheader formatting.\n\n```python\nst.subheader(\"This is a subheader\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Badge

\n\nDisplay a small, colored badge.\n\n```python\nst.badge(\"New\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Caption

\n\nDisplay text in small font.\n\n```python\nst.caption(\"This is written small caption text\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Code block

\n\nDisplay a code block with optional syntax highlighting.\n\n```python\nst.code(\"a = 1234\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Echo

\n\nDisplay some code in the app, then execute it. Useful for tutorials.\n\n```python\nwith st.echo():\n st.write('This code will be printed')\n```\n\n
\n\n\n\"screenshot\"\n\n

LaTeX

\n\nDisplay mathematical expressions formatted as LaTeX.\n\n```python\nst.latex(\"\\int a x^2 \\,dx\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Preformatted text

\n\nWrite fixed-width and preformatted text.\n\n```python\nst.text(\"Hello world\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Divider

\n\nDisplay a horizontal rule.\n\n```python\nst.divider()\n```\n\n
\n\n\n

Get help

\n\nDisplay object’s doc string, nicely formatted.\n\n```python\nst.help(st.write)\nst.help(pd.DataFrame)\n```\n\n
\n\n\n

Render HTML

\n\nRenders HTML strings to your app.\n\n```python\nst.html(\"

Foo bar.

\")\n```\n\n
\n
\n\n\n\n\n\"screenshot\"\n\n

Annotated text

\n\nDisplay annotated text in Streamlit apps. Created by [@tvst](https://github.com/tvst).\n\n```python\nannotated_text(\"This \", (\"is\", \"verb\"), \" some \", (\"annotated\", \"adj\"), (\"text\", \"noun\"), \" for those of \", (\"you\", \"pronoun\"), \" who \", (\"like\", \"verb\"), \" this sort of \", (\"thing\", \"noun\"), \".\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Drawable Canvas

\n\nProvides a sketching canvas using [Fabric.js](http://fabricjs.com/). Created by [@andfanilo](https://github.com/andfanilo).\n\n```python\nst_canvas(fill_color=\"rgba(255, 165, 0, 0.3)\", stroke_width=stroke_width, stroke_color=stroke_color, background_color=bg_color, background_image=Image.open(bg_image) if bg_image else None, update_streamlit=realtime_update, height=150, drawing_mode=drawing_mode, point_display_radius=point_display_radius if drawing_mode == 'point' else 0, key=\"canvas\",)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Tags

\n\nAdd tags to your Streamlit apps. Created by [@gagan3012](https://github.com/gagan3012).\n\n```python\nst_tags(label='# Enter Keywords:', text='Press enter to add more', value=['Zero', 'One', 'Two'], suggestions=['five', 'six', 'seven', 'eight', 'nine', 'three', 'eleven', 'ten', 'four'], maxtags = 4, key='1')\n```\n\n
\n\n\n\n\"screenshot\"\n\n

NLU

\n\nApply text mining on a dataframe. Created by [@JohnSnowLabs](https://github.com/JohnSnowLabs/).\n\n```python\nnlu.load('sentiment').predict('I love NLU! <3')\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Extras

\n\nA library with useful Streamlit extras. Created by [@arnaudmiribel](https://github.com/arnaudmiribel/).\n\n```python\nmention(label=\"An awesome Streamlit App\", icon=\"streamlit\", url=\"https://extras.streamlit.app\",)\n```\n\n
\n
\n\n### Data elements\n\n
\n\n\n\n\"screenshot\"\n\n

Dataframes

\n\nDisplay a dataframe as an interactive table.\n\n```python\nst.dataframe(my_data_frame)\n```\n\n
\n\n\n\"screenshot\"\n\n

Data editor

\n\nDisplay a data editor widget.\n\n```python\nedited = st.data_editor(df, num_rows=\"dynamic\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Column configuration

\n\nConfigure the display and editing behavior of dataframes and data editors.\n\n```python\nst.column_config.NumberColumn(\"Price (in USD)\", min_value=0, format=\"$%d\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Static tables

\n\nDisplay a static table.\n\n```python\nst.table(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Metrics

\n\nDisplay a metric in big bold font, with an optional indicator of how the metric changed.\n\n```python\nst.metric(\"My metric\", 42, 2)\n```\n\n
\n\n\"screenshot\"\n\n

Dicts and JSON

\n\nDisplay object or string as a pretty-printed JSON string.\n\n```python\nst.json(my_dict)\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Streamlit Aggrid

\n\nImplementation of Ag-Grid component for Streamlit. Created by [@PablocFonseca](https://github.com/PablocFonseca).\n\n```python\ndf = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]})\ngrid_return = AgGrid(df, editable=True)\n\nnew_df = grid_return['data']\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Folium

\n\nStreamlit Component for rendering Folium maps. Created by [@randyzwitch](https://github.com/randyzwitch).\n\n```python\nm = folium.Map(location=[39.949610, -75.150282], zoom_start=16)\nfolium.Marker([39.949610, -75.150282], popup=\"Liberty Bell\", tooltip=\"Liberty Bell\").add_to(m)\n\nst_data = st_folium(m, width=725)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Pandas Profiling

\n\nPandas profiling component for Streamlit. Created by [@okld](https://github.com/okld/).\n\n```python\ndf = pd.read_csv(\"https://storage.googleapis.com/tf-datasets/titanic/train.csv\")\npr = df.profile_report()\n\nst_profile_report(pr)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Image Coordinates

\n\nGet the coordinates of clicks on an image. Created by [@blackary](https://github.com/blackary/).\n\n```python\nfrom streamlit_image_coordinates import streamlit_image_coordinates\nvalue = streamlit_image_coordinates(\"https://placekitten.com/200/300\")\n\nst.write(value)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Plotly Events

\n\nMake Plotly charts interactive!. Created by [@null-jones](https://github.com/null-jones/).\n\n```python\nfrom streamlit_plotly_events import plotly_events\nfig = px.line(x=[1], y=[1])\n\nselected_points = plotly_events(fig)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Extras

\n\nA library with useful Streamlit extras. Created by [@arnaudmiribel](https://github.com/arnaudmiribel/).\n\n```python\nfrom streamlit_extras.metric_cards import style_metric_cards\ncol3.metric(label=\"No Change\", value=5000, delta=0)\n\nstyle_metric_cards()\n```\n\n
\n\n
\n\n### Chart elements\n\n
\n\n\n\n\n\"screenshot\"\n\n

Simple area charts

\n\nDisplay an area chart.\n\n```python\nst.area_chart(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Simple bar charts

\n\nDisplay a bar chart.\n\n```python\nst.bar_chart(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Simple line charts

\n\nDisplay a line chart.\n\n```python\nst.line_chart(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Simple scatter charts

\n\nDisplay a line chart.\n\n```python\nst.scatter_chart(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Scatterplots on maps

\n\nDisplay a map with points on it.\n\n```python\nst.map(my_data_frame)\n```\n\n
\n\n\"screenshot\"\n\n

Matplotlib

\n\nDisplay a matplotlib.pyplot figure.\n\n```python\nst.pyplot(my_mpl_figure)\n```\n\n
\n\n\"screenshot\"\n\n

Altair

\n\nDisplay a chart using the Altair library.\n\n```python\nst.altair_chart(my_altair_chart)\n```\n\n
\n\n\"screenshot\"\n\n

Vega-Lite

\n\nDisplay a chart using the Vega-Lite library.\n\n```python\nst.vega_lite_chart(my_vega_lite_chart)\n```\n\n
\n\n\"screenshot\"\n\n

Plotly

\n\nDisplay an interactive Plotly chart.\n\n```python\nst.plotly_chart(my_plotly_chart)\n```\n\n
\n\n\"screenshot\"\n\n

Bokeh

\n\nDisplay an interactive Bokeh chart.\n\n```python\nst.bokeh_chart(my_bokeh_chart)\n```\n\n
\n\n\"screenshot\"\n\n

PyDeck

\n\nDisplay a chart using the PyDeck library.\n\n```python\nst.pydeck_chart(my_pydeck_chart)\n```\n\n
\n\n\"screenshot\"\n\n

GraphViz

\n\nDisplay a graph using the dagre-d3 library.\n\n```python\nst.graphviz_chart(my_graphviz_spec)\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Plost

\n\nA deceptively simple plotting library for Streamlit. Created by [@tvst](https://github.com/tvst).\n\n```python\nimport plost\nplost.line_chart(my_dataframe, x='time', y='stock_value', color='stock_name',)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

HiPlot

\n\nHigh dimensional Interactive Plotting. Created by [@facebookresearch](https://github.com/facebookresearch).\n\n```python\ndata = [{'dropout':0.1, 'lr': 0.001, 'loss': 10.0, 'optimizer': 'SGD'}, {'dropout':0.15, 'lr': 0.01, 'loss': 3.5, 'optimizer': 'Adam'}, {'dropout':0.3, 'lr': 0.1, 'loss': 4.5, 'optimizer': 'Adam'}]\nhip.Experiment.from_iterable(data).display()\n```\n\n
\n\n\n\n\"screenshot\"\n\n

ECharts

\n\nHigh dimensional Interactive Plotting. Created by [@andfanilo](https://github.com/andfanilo).\n\n```python\nfrom streamlit_echarts import st_echarts\nst_echarts(options=options)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Folium

\n\nStreamlit Component for rendering Folium maps. Created by [@randyzwitch](https://github.com/randyzwitch).\n\n```python\nm = folium.Map(location=[39.949610, -75.150282], zoom_start=16)\nst_data = st_folium(m, width=725)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Spacy-Streamlit

\n\nspaCy building blocks and visualizers for Streamlit apps. Created by [@explosion](https://github.com/explosion).\n\n```python\nmodels = [\"en_core_web_sm\", \"en_core_web_md\"]\nspacy_streamlit.visualize(models, \"Sundar Pichai is the CEO of Google.\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Agraph

\n\nA Streamlit Graph Vis, based on [react-grah-vis](https://github.com/crubier/react-graph-vis). Created by [@ChrisDelClea](https://github.com/ChrisDelClea).\n\n```python\nfrom streamlit_agraph import agraph, Node, Edge, Config\nagraph(nodes=nodes, edges=edges, config=config)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Lottie

\n\nIntegrate [Lottie](https://lottiefiles.com/) animations inside your Streamlit app. Created by [@andfanilo](https://github.com/andfanilo).\n\n```python\nlottie_hello = load_lottieurl(\"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\")\nst_lottie(lottie_hello, key=\"hello\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Plotly Events

\n\nMake Plotly charts interactive!. Created by [@null-jones](https://github.com/null-jones/).\n\n```python\nfig = px.line(x=[1], y=[1])\nselected_points = plotly_events(fig)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Extras

\n\nA library with useful Streamlit extras. Created by [@arnaudmiribel](https://github.com/arnaudmiribel/).\n\n```python\nchart += get_annotations_chart(annotations=[(\"Mar 01, 2008\", \"Pretty good day for GOOG\"), (\"Dec 01, 2007\", \"Something's going wrong for GOOG & AAPL\"), (\"Nov 01, 2008\", \"Market starts again thanks to...\"), (\"Dec 01, 2009\", \"Small crash for GOOG after...\"),],)\nst.altair_chart(chart, use_container_width=True)\n```\n\n
\n\n
\n\n### Input widgets\n\n
\n\n\n\n\n\"screenshot\"\n\n

Button

\n\nDisplay a button widget.\n\n```python\nclicked = st.button(\"Click me\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Download button

\n\nDisplay a download button widget.\n\n```python\nst.download_button(\"Download file\", file)\n```\n\n
\n\n\n\"screenshot\"\n\n

Form button

\n\nDisplay a form submit button. For use with `st.form`.\n\n```python\nst.form_submit_button(\"Sign up\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Link button

\n\nDisplay a link button.\n\n```python\nst.link_button(\"Go to gallery\", url)\n```\n\n
\n\n\n\"screenshot\"\n\n

Page link

\n\nDisplay a link to another page in a multipage app.\n\n```python\nst.page_link(\"app.py\", label=\"Home\", icon=\"🏠\")\nst.page_link(\"pages/profile.py\", label=\"My profile\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Checkbox

\n\nDisplay a checkbox widget.\n\n```python\nselected = st.checkbox(\"I agree\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Color picker

\n\nDisplay a color picker widget.\n\n```python\ncolor = st.color_picker(\"Pick a color\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Feedback

\n\nDisplay a rating or sentiment button group.\n\n```python\nst.feedback(\"stars\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Multiselect

\n\nDisplay a multiselect widget. The multiselect widget starts as empty.\n\n```python\nchoices = st.multiselect(\"Buy\", [\"milk\", \"apples\", \"potatoes\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Pills

\n\nDisplay a pill-button selection widget.\n\n```python\nst.pills(\"Tags\", [\"Sports\", \"AI\", \"Politics\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Radio

\n\nDisplay a radio button widget.\n\n```python\nchoice = st.radio(\"Pick one\", [\"cats\", \"dogs\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Segmented control

\n\nDisplay a segmented-button selection widget.\n\n```python\nst.segmented_control(\"Filter\", [\"Open\", \"Closed\", \"All\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Selectbox

\n\nDisplay a select widget.\n\n```python\nchoice = st.selectbox(\"Pick one\", [\"cats\", \"dogs\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Select-slider

\n\nDisplay a slider widget to select items from a list.\n\n```python\nsize = st.select_slider(\"Pick a size\", [\"S\", \"M\", \"L\"])\n```\n\n
\n\n\n\"screenshot\"\n\n

Toggle

\n\nDisplay a toggle widget.\n\n```python\nactivated = st.toggle(\"Activate\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Number input

\n\nDisplay a numeric input widget.\n\n```python\nchoice = st.number_input(\"Pick a number\", 0, 10)\n```\n\n
\n\n\n\"screenshot\"\n\n

Slider

\n\nDisplay a slider widget.\n\n```python\nnumber = st.slider(\"Pick a number\", 0, 100)\n```\n\n
\n\n\n\"screenshot\"\n\n

Date input

\n\nDisplay a date input widget.\n\n```python\ndate = st.date_input(\"Your birthday\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Time input

\n\nDisplay a time input widget.\n\n```python\ntime = st.time_input(\"Meeting time\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Chat input

\n\nDisplay a chat input widget.\n\n```python\nprompt = st.chat_input(\"Say something\")\nif prompt:\n st.write(f\"The user has sent: {prompt}\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Text-area

\n\nDisplay a multi-line text input widget.\n\n```python\ntext = st.text_area(\"Text to translate\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Text input

\n\nDisplay a single-line text input widget.\n\n```python\nname = st.text_input(\"First name\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Audio input

\n\nDisplay a widget that allows users to record with their microphone.\n\n```python\nspeech = st.audio_input(\"Record a voice message\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Data editor

\n\nDisplay a data editor widget.\n\n```python\nedited = st.data_editor(df, num_rows=\"dynamic\")\n```\n\n
\n\n\n\"screenshot\"\n\n

File uploader

\n\nDisplay a file uploader widget.\n\n```python\ndata = st.file_uploader(\"Upload a CSV\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Camera input

\n\nDisplay a widget that allows users to upload images directly from a camera.\n\n```python\nimage = st.camera_input(\"Take a picture\")\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Streamlit Elements

\n\nCreate a draggable and resizable dashboard in Streamlit. Created by [@okls](https://github.com/okls).\n\n```python\nfrom streamlit_elements import elements, mui, html\n\nwith elements(\"new_element\"):\n mui.Typography(\"Hello world\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Tags

\n\nAdd tags to your Streamlit apps. Created by [@gagan3012](https://github.com/gagan3012).\n\n```python\nfrom streamlit_tags import st_tags\n\nst_tags(label='# Enter Keywords:', text='Press enter to add more', value=['Zero', 'One', 'Two'],\nsuggestions=['five', 'six', 'seven', 'eight', 'nine', 'three', 'eleven', 'ten', 'four'], maxtags = 4, key='1')\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Stqdm

\n\nThe simplest way to handle a progress bar in streamlit app. Created by [@Wirg](https://github.com/Wirg).\n\n```python\nfrom stqdm import stqdm\n\nfor _ in stqdm(range(50)):\n sleep(0.5)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Timeline

\n\nDisplay a Timeline in Streamlit apps using [TimelineJS](https://timeline.knightlab.com/). Created by [@innerdoc](https://github.com/innerdoc).\n\n```python\nfrom streamlit_timeline import timeline\n\nwith open('example.json', \"r\") as f:\n timeline(f.read(), height=800)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Camera input live

\n\nAlternative for st.camera_input which returns the webcam images live. Created by [@blackary](https://github.com/blackary).\n\n```python\nfrom camera_input_live import camera_input_live\n\nimage = camera_input_live()\nst.image(value)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Ace

\n\nAce editor component for Streamlit. Created by [@okld](https://github.com/okld).\n\n```python\nfrom streamlit_ace import st_ace\n\ncontent = st_ace()\ncontent\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Chat

\n\nStreamlit Component for a Chatbot UI. Created by [@AI-Yash](https://github.com/AI-Yash).\n\n```python\nfrom streamlit_chat import message\n\nmessage(\"My message\")\nmessage(\"Hello bot!\", is_user=True) # align's the message to the right\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Option Menu

\n\nSelect a single item from a list of options in a menu. Created by [@victoryhb](https://github.com/victoryhb).\n\n```python\nfrom streamlit_option_menu import option_menu\n\noption_menu(\"Main Menu\", [\"Home\", 'Settings'],\n icons=['house', 'gear'], menu_icon=\"cast\", default_index=1)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Extras

\n\nA library with useful Streamlit extras. Created by [@arnaudmiribel](https://github.com/arnaudmiribel/).\n\n```python\nfrom streamlit_extras.stoggle import stoggle\n\nstoggle(\n \"Click me!\", \"\"\"🥷 Surprise! Here's some additional content\"\"\",)\n```\n\n
\n\n
\n\n### Media elements\n\n
\n\n\n\n\n\"screenshot\"\n\n

Image

\n\nDisplay an image or list of images.\n\n```python\nst.image(numpy_array)\nst.image(image_bytes)\nst.image(file)\nst.image(\"https://example.com/myimage.jpg\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Logo

\n\nDisplay a logo in the upper-left corner of your app and its sidebar.\n\n```python\nst.logo(\"logo.jpg\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Audio

\n\nDisplay an audio player.\n\n```python\nst.audio(numpy_array)\nst.audio(audio_bytes)\nst.audio(file)\nst.audio(\"https://example.com/myaudio.mp3\", format=\"audio/mp3\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Video

\n\nDisplay a video player.\n\n```python\nst.video(numpy_array)\nst.video(video_bytes)\nst.video(file)\nst.video(\"https://example.com/myvideo.mp4\", format=\"video/mp4\")\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Streamlit Webrtc

\n\nHandling and transmitting real-time video/audio streams with Streamlit. Created by [@whitphx](https://github.com/whitphx).\n\n```python\nfrom streamlit_webrtc import webrtc_streamer\n\nwebrtc_streamer(key=\"sample\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Drawable Canvas

\n\nProvides a sketching canvas using [Fabric.js](http://fabricjs.com/). Created by [@andfanilo](https://github.com/andfanilo).\n\n```python\nfrom streamlit_drawable_canvas import st_canvas\n\nst_canvas(fill_color=\"rgba(255, 165, 0, 0.3)\", stroke_width=stroke_width, stroke_color=stroke_color, background_color=bg_color, background_image=Image.open(bg_image) if bg_image else None, update_streamlit=realtime_update, height=150, drawing_mode=drawing_mode, point_display_radius=point_display_radius if drawing_mode == 'point' else 0, key=\"canvas\",)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Image Comparison

\n\nCompare images with a slider using [JuxtaposeJS](https://juxtapose.knightlab.com/). Created by [@fcakyon](https://github.com/fcakyon).\n\n```python\nfrom streamlit_image_comparison import image_comparison\n\nimage_comparison(img1=\"image1.jpg\", img2=\"image2.jpg\",)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Cropper

\n\nA simple image cropper for Streamlit. Created by [@turner-anderson](https://github.com/turner-anderson).\n\n```python\nfrom streamlit_cropper import st_cropper\n\nst_cropper(img, realtime_update=realtime_update, box_color=box_color, aspect_ratio=aspect_ratio)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Image Coordinates

\n\nGet the coordinates of clicks on an image. Created by [@blackary](https://github.com/blackary/).\n\n```python\nfrom streamlit_image_coordinates import streamlit_image_coordinates\n\nstreamlit_image_coordinates(\"https://placekitten.com/200/300\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Lottie

\n\nIntegrate [Lottie](https://lottiefiles.com/) animations inside your Streamlit app. Created by [@andfanilo](https://github.com/andfanilo).\n\n```python\nlottie_hello = load_lottieurl(\"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\")\n\nst_lottie(lottie_hello, key=\"hello\")\n```\n\n
\n\n
\n\n### Layouts and containers\n\n
\n\n\n\n\n\"screenshot\"\n\n

Columns

\n\nInsert containers laid out as side-by-side columns.\n\n```python\ncol1, col2 = st.columns(2)\ncol1.write(\"this is column 1\")\ncol2.write(\"this is column 2\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Container

\n\nInsert a multi-element container.\n\n```python\nc = st.container()\nst.write(\"This will show last\")\nc.write(\"This will show first\")\nc.write(\"This will show second\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Modal dialog

\n\nInsert a modal dialog that can rerun independently from the rest of the script.\n\n```python\n@st.dialog(\"Sign up\")\ndef email_form():\n name = st.text_input(\"Name\")\n email = st.text_input(\"Email\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Empty

\n\nInsert a single-element container.\n\n```python\nc = st.empty()\nst.write(\"This will show last\")\nc.write(\"This will be replaced\")\nc.write(\"This will show first\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Expander

\n\nInsert a multi-element container that can be expanded/collapsed.\n\n```python\nwith st.expander(\"Open to see more\"):\n st.write(\"This is more content\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Popover

\n\nInsert a multi-element popover container that can be opened/closed.\n\n```python\nwith st.popover(\"Settings\"):\n st.checkbox(\"Show completed\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Sidebar

\n\nDisplay items in a sidebar.\n\n```python\nst.sidebar.write(\"This lives in the sidebar\")\nst.sidebar.button(\"Click me!\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Tabs

\n\nInsert containers separated into tabs.\n\n```python\ntab1, tab2 = st.tabs([\"Tab 1\", \"Tab2\"])\ntab1.write(\"this is tab 1\")\ntab2.write(\"this is tab 2\")\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Streamlit Elements

\n\nCreate a draggable and resizable dashboard in Streamlit. Created by [@okls](https://github.com/okls).\n\n```python\nfrom streamlit_elements import elements, mui, html\n\nwith elements(\"new_element\"):\n mui.Typography(\"Hello world\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Pydantic

\n\nAuto-generate Streamlit UI from Pydantic Models and Dataclasses. Created by [@lukasmasuch](https://github.com/lukasmasuch).\n\n```python\nimport streamlit_pydantic as sp\n\nsp.pydantic_form(key=\"my_form\",\n model=ExampleModel)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Pages

\n\nAn experimental version of Streamlit Multi-Page Apps. Created by [@blackary](https://github.com/blackary).\n\n```python\nfrom st_pages import Page, show_pages, add_page_title\n\nshow_pages([ Page(\"streamlit_app.py\", \"Home\", \"🏠\"),\n Page(\"other_pages/page2.py\", \"Page 2\", \":books:\"), ])\n```\n\n
\n\n
\n\n### Chat elements\n\n
\n\nStreamlit provides a few commands to help you build conversational apps. These chat elements are designed to be used in conjunction with each other, but you can also use them separately.\n\n`st.chat_message` lets you insert a chat message container into the app so you can display messages from the user or the app. Chat containers can contain other Streamlit elements, including charts, tables, text, and more. `st.chat_input` lets you display a chat input widget so the user can type in a message.\n\n\n\n\n\"screenshot\"\n\n

Chat input

\n\nDisplay a chat input widget.\n\n```python\nprompt = st.chat_input(\"Say something\")\nif prompt:\n st.write(f\"The user has sent: {prompt}\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Chat message

\n\nInsert a chat message container.\n\n```python\nimport numpy as np\nwith st.chat_message(\"user\"):\n st.write(\"Hello 👋\")\n st.line_chart(np.random.randn(30, 3))\n```\n\n
\n\n\n\"screenshot\"\n\n

Status container

\n\nDisplay output of long-running tasks in a container.\n\n```python\nwith st.status('Running'):\n do_something_slow()\n```\n\n
\n\n\n

st.write_stream

\n\nWrite generators or streams to the app with a typewriter effect.\n\n```python\nst.write_stream(my_generator)\nst.write_stream(my_llm_stream)\n```\n\n
\n
\n\n### Status elements\n\n
\n\n\n\n\n\"screenshot\"\n\n

Progress bar

\n\nDisplay a progress bar.\n\n```python\nfor i in range(101):\n st.progress(i)\n do_something_slow()\n```\n\n
\n\n\n\"screenshot\"\n\n

Spinner

\n\nTemporarily displays a message while executing a block of code.\n\n```python\nwith st.spinner(\"Please wait...\"):\n do_something_slow()\n```\n\n
\n\n\n\"screenshot\"\n\n

Status container

\n\nDisplay output of long-running tasks in a container.\n\n```python\nwith st.status('Running'):\n do_something_slow()\n```\n\n
\n\n\n\"screenshot\"\n\n

Toast

\n\nBriefly displays a toast message in the bottom-right corner.\n\n```python\nst.toast('Butter!', icon='🧈')\n```\n\n
\n\n\n\"screenshot\"\n\n

Balloons

\n\nDisplay celebratory balloons!\n\n```python\ndo_something()\n\n# Celebrate when all done!\nst.balloons()\n```\n\n
\n\n\n\"screenshot\"\n\n

Snowflakes

\n\nDisplay celebratory snowflakes!\n\n```python\ndo_something()\n\n# Celebrate when all done!\nst.snow()\n```\n\n
\n\n\n\"screenshot\"\n\n

Success box

\n\nDisplay a success message.\n\n```python\nst.success(\"Match found!\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Info box

\n\nDisplay an informational message.\n\n```python\nst.info(\"Dataset is updated every day at midnight.\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Warning box

\n\nDisplay warning message.\n\n```python\nst.warning(\"Unable to fetch image. Skipping...\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Error box

\n\nDisplay error message.\n\n```python\nst.error(\"We encountered an error\")\n```\n\n
\n\n\n\"screenshot\"\n\n

Exception output

\n\nDisplay an exception.\n\n```python\ne = RuntimeError(\"This is an exception of type RuntimeError\")\nst.exception(e)\n```\n\n
\n\n
\n\n\n\n\n\n\"screenshot\"\n\n

Stqdm

\n\nThe simplest way to handle a progress bar in streamlit app. Created by [@Wirg](https://github.com/Wirg).\n\n```python\nfrom stqdm import stqdm\n\nfor _ in stqdm(range(50)):\n sleep(0.5)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Custom notification box

\n\nA custom notification box with the ability to close it out. Created by [@Socvest](https://github.com/Socvest).\n\n```python\nfrom streamlit_custom_notification_box import custom_notification_box\n\nstyles = {'material-icons':{'color': 'red'}, 'text-icon-link-close-container': {'box-shadow': '#3896de 0px 4px'}, 'notification-text': {'':''}, 'close-button':{'':''}, 'link':{'':''}}\ncustom_notification_box(icon='info', textDisplay='We are almost done with your registration...', externalLink='more info', url='#', styles=styles, key=\"foo\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Extras

\n\nA library with useful Streamlit extras. Created by [@arnaudmiribel](https://github.com/arnaudmiribel/).\n\n```python\nfrom streamlit_extras.let_it_rain import rain\n\nrain(emoji=\"🎈\", font_size=54,\n falling_speed=5, animation_length=\"infinite\",)\n```\n\n
\n\n
\n\n## App logic and configuration\n\n### Authentication and user info\n\n
\n\n\n\n\n

Log in a user

\n\n`st.login()` starts an authentication flow with an identity provider.\n\n```python\nst.login()\n```\n\n
\n\n\n

Log out a user

\n\n`st.logout()` removes a user's identity information.\n\n```python\nst.logout()\n```\n\n
\n\n\n

User info

\n\n`st.user` returns information about a logged-in user.\n\n```python\nif st.user.is_logged_in:\n st.write(f\"Welcome back, {st.user.name}!\")\n```\n\n
\n
\n\n### Navigation and pages\n\n
\n\n\n\n\n\n\"screenshot\"\n\n

Navigation

\n\nConfigure the available pages in a multipage app.\n\n```python\nst.navigation({\n \"Your account\" : [log_out, settings],\n \"Reports\" : [overview, usage],\n \"Tools\" : [search]\n})\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Page

\n\nDefine a page in a multipage app.\n\n```python\nhome = st.Page(\n \"home.py\",\n title=\"Home\",\n icon=\":material/home:\"\n)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Page link

\n\nDisplay a link to another page in a multipage app.\n\n```python\nst.page_link(\"app.py\", label=\"Home\", icon=\"🏠\")\nst.page_link(\"pages/profile.py\", label=\"My profile\")\n```\n\n
\n\n\n\n

Switch page

\n\nProgrammatically navigates to a specified page.\n\n```python\nst.switch_page(\"pages/my_page.py\")\n```\n\n
\n\n
\n\n### Execution flow\n\n
\n\n\n\n\n\"screenshot\"\n\n

Modal dialog

\n\nInsert a modal dialog that can rerun independently from the rest of the script.\n\n```python\n@st.dialog(\"Sign up\")\ndef email_form():\n name = st.text_input(\"Name\")\n email = st.text_input(\"Email\")\n```\n\n
\n\n\n

Forms

\n\nCreate a form that batches elements together with a “Submit\" button.\n\n```python\nwith st.form(key='my_form'):\n name = st.text_input(\"Name\")\n email = st.text_input(\"Email\")\n st.form_submit_button(\"Sign up\")\n```\n\n
\n\n\n

Fragments

\n\nDefine a fragment to rerun independently from the rest of the script.\n\n```python\n@st.fragment(run_every=\"10s\")\ndef fragment():\n df = get_data()\n st.line_chart(df)\n```\n\n
\n\n\n

Rerun script

\n\nRerun the script immediately.\n\n```python\nst.rerun()\n```\n\n
\n\n\n

Stop execution

\n\nStops execution immediately.\n\n```python\nst.stop()\n```\n\n
\n
\n\n\n\n\n\n\"screenshot\"\n\n

Autorefresh

\n\nForce a refresh without tying up a script. Created by [@kmcgrady](https://github.com/kmcgrady).\n\n```python\nfrom streamlit_autorefresh import st_autorefresh\n\nst_autorefresh(interval=2000, limit=100,\n key=\"fizzbuzzcounter\")\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Pydantic

\n\nAuto-generate Streamlit UI from Pydantic Models and Dataclasses. Created by [@lukasmasuch](https://github.com/lukasmasuch).\n\n```python\nimport streamlit_pydantic as sp\n\nsp.pydantic_form(key=\"my_form\",\n model=ExampleModel)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Pages

\n\nAn experimental version of Streamlit Multi-Page Apps. Created by [@blackary](https://github.com/blackary).\n\n```python\nfrom st_pages import Page, show_pages, add_page_title\n\nshow_pages([ Page(\"streamlit_app.py\", \"Home\", \"🏠\"),\n Page(\"other_pages/page2.py\", \"Page 2\", \":books:\"), ])\n```\n\n
\n\n
\n\n### Caching and state\n\n
\n\n\n\n\n

Cache data

\n\nFunction decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).\n\n```python\n@st.cache_data\ndef long_function(param1, param2):\n # Perform expensive computation here or\n # fetch data from the web here\n return data\n```\n\n
\n\n\n\n

Cache resource

\n\nFunction decorator to cache functions that return global resources (e.g. database connections, ML models).\n\n```python\n@st.cache_resource\ndef init_model():\n # Return a global resource here\n return pipeline(\n \"sentiment-analysis\",\n model=\"distilbert-base-uncased-finetuned-sst-2-english\"\n )\n```\n\n
\n\n\n\n

Session state

\n\nSession state is a way to share variables between reruns, for each user session.\n\n```python\nst.session_state['key'] = value\n```\n\n
\n\n\n\n

Query parameters

\n\nGet, set, or clear the query parameters that are shown in the browser's URL bar.\n\n```python\nst.query_params[key] = value\nst.query_params.clear()\n```\n\n
\n\n\n

Context

\n\n`st.context` provides a read-only interface to access cookies, headers, locale, and other browser-session information.\n\n```python\nst.context.cookies\nst.context.headers\n```\n\n
\n\n
\n\n### Connections and databases\n\n#### Setup your connection\n\n\n\n\n\"screenshot\"\n\n

Create a connection

\n\nConnect to a data source or API\n\n```python\nconn = st.connection('pets_db', type='sql')\npet_owners = conn.query('select * from pet_owners')\nst.dataframe(pet_owners)\n```\n\n
\n
\n\n#### Built-in connections\n\n\n\n\n\n\"screenshot\"\n\n

SnowflakeConnection

\n\nA connection to Snowflake.\n\n```python\nconn = st.connection('snowflake')\n```\n\n
\n\n\n\n\"screenshot\"\n\n

SQLConnection

\n\nA connection to a SQL database using SQLAlchemy.\n\n```python\nconn = st.connection('sql')\n```\n\n
\n
\n\n#### Build your own connections\n\n\n\n\n

Connection base class

\n\nBuild your own connection with `BaseConnection`.\n\n```python\nclass MyConnection(BaseConnection[myconn.MyConnection]):\n def _connect(self, **kwargs) -> MyConnection:\n return myconn.connect(**self._secrets, **kwargs)\n def query(self, query):\n return self._instance.query(query)\n```\n\n
\n\n
\n\n#### Secrets management\n\n\n\n\n\n

Secrets singleton

\n\nAccess secrets from a local TOML file.\n\n```python\nkey = st.secrets[\"OpenAI_key\"]\n```\n\n
\n\n\n

Secrets file

\n\nSave your secrets in a per-project or per-profile TOML file.\n\n```python\nOpenAI_key = \"\"\n```\n\n
\n\n
\n\n\n\n\n\n\"screenshot\"\n\n

Authenticator

\n\nA secure authentication module to validate user credentials. Created by [@mkhorasani](https://github.com/mkhorasani).\n\n```python\nimport streamlit_authenticator as stauth\n\nauthenticator = stauth.Authenticate( config['credentials'], config['cookie']['name'],\nconfig['cookie']['key'], config['cookie']['expiry_days'], config['preauthorized'])\n```\n\n
\n\n\n\n\"screenshot\"\n\n

WS localStorage

\n\nA simple synchronous way of accessing localStorage from your app. Created by [@gagangoku](https://github.com/gagangoku).\n\n```python\nfrom streamlit_ws_localstorage import injectWebsocketCode\n\nret = conn.setLocalStorageVal(key='k1', val='v1')\nst.write('ret: ' + ret)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Auth0

\n\nThe fastest way to provide comprehensive login inside Streamlit. Created by [@conradbez](https://github.com/conradbez).\n\n```python\nfrom auth0_component import login_button\n\nuser_info = login_button(clientId, domain = domain)\nst.write(user_info)\n```\n\n
\n\n
\n\n### Custom Components\n\n
\n\n\n\n\n\n

Declare a component

\n\nCreate and register a custom component.\n\n```python\nfrom st.components.v1 import declare_component\ndeclare_component(\n \"custom_slider\",\n \"/frontend\",\n)\n```\n\n
\n\n\n\n

HTML

\n\nDisplay an HTML string in an iframe.\n\n```python\nfrom st.components.v1 import html\nhtml(\n \"

Foo bar.

\"\n)\n```\n\n
\n\n\n\n

iframe

\n\nLoad a remote URL in an iframe.\n\n```python\nfrom st.components.v1 import iframe\niframe(\n \"docs.streamlit.io\"\n)\n```\n\n
\n\n
\n\n### Configuration\n\n
\n\n\n\n\n

Configuration file

\n\nConfigures the default settings for your app.\n\n```\nyour-project/\n├── .streamlit/\n│ └── config.toml\n└── your_app.py\n```\n\n
\n\n\n

Get config option

\n\nRetrieve a single configuration option.\n\n```python\nst.get_option(\"theme.primaryColor\")\n```\n\n
\n\n\n

Set config option

\n\nSet a single configuration option. (This is very limited.)\n\n```python\nst.set_option(\"deprecation.showPyplotGlobalUse\", False)\n```\n\n
\n\n\n

Set page title, favicon, and more

\n\nConfigures the default settings of the page.\n\n```python\nst.set_page_config(\n page_title=\"My app\",\n page_icon=\":shark:\",\n)\n```\n\n
\n
\n\n## Developer tools\n\n### App testing\n\n
\n\n\n\n\n\n

st.testing.v1.AppTest

\n\n`st.testing.v1.AppTest` simulates a running Streamlit app for testing.\n\n```python\nfrom streamlit.testing.v1 import AppTest\n\nat = AppTest.from_file(\"streamlit_app.py\")\nat.secrets[\"WORD\"] = \"Foobar\"\nat.run()\nassert not at.exception\n\nat.text_input(\"word\").input(\"Bazbat\").run()\nassert at.warning[0].value == \"Try again.\"\n```\n\n
\n\n\n\n

AppTest.from_file

\n\n`st.testing.v1.AppTest.from_file` initializes a simulated app from a file.\n\n```python\nfrom streamlit.testing.v1 import AppTest\n\nat = AppTest.from_file(\"streamlit_app.py\")\nat.run()\n```\n\n
\n\n\n\n

AppTest.from_string

\n\n`st.testing.v1.AppTest.from_string` initializes a simulated app from a string.\n\n```python\nfrom streamlit.testing.v1 import AppTest\n\nat = AppTest.from_string(app_script_as_string)\nat.run()\n```\n\n
\n\n\n\n

AppTest.from_function

\n\n`st.testing.v1.AppTest.from_function` initializes a simulated app from a function.\n\n```python\nfrom streamlit.testing.v1 import AppTest\n\nat = AppTest.from_function(app_script_as_callable)\nat.run()\n```\n\n
\n\n\n\n

Block

\n\nA representation of container elements, including:\n\n- `st.chat_message`\n- `st.columns`\n- `st.sidebar`\n- `st.tabs`\n- The main body of the app.\n\n```python\n# at.sidebar returns a Block\nat.sidebar.button[0].click().run()\nassert not at.exception\n```\n\n
\n\n\n\n

Element

\n\nThe base class for representation of all elements, including:\n\n- `st.title`\n- `st.header`\n- `st.markdown`\n- `st.dataframe`\n\n```python\n# at.title returns a sequence of Title\n# Title inherits from Element\nassert at.title[0].value == \"My awesome app\"\n```\n\n
\n\n\n\n

Button

\n\nA representation of `st.button` and `st.form_submit_button`.\n\n```python\nat.button[0].click().run()\n```\n\n
\n\n\n\n

ChatInput

\n\nA representation of `st.chat_input`.\n\n```python\nat.chat_input[0].set_value(\"What is Streamlit?\").run()\n```\n\n
\n\n\n\n

Checkbox

\n\nA representation of `st.checkbox`.\n\n```python\nat.checkbox[0].check().run()\n```\n\n
\n\n\n\n

ColorPicker

\n\nA representation of `st.color_picker`.\n\n```python\nat.color_picker[0].pick(\"#FF4B4B\").run()\n```\n\n
\n\n\n\n

DateInput

\n\nA representation of `st.date_input`.\n\n```python\nrelease_date = datetime.date(2023, 10, 26)\nat.date_input[0].set_value(release_date).run()\n```\n\n
\n\n\n\n

Multiselect

\n\nA representation of `st.multiselect`.\n\n```python\nat.multiselect[0].select(\"New York\").run()\n```\n\n
\n\n\n\n

NumberInput

\n\nA representation of `st.number_input`.\n\n```python\nat.number_input[0].increment().run()\n```\n\n
\n\n\n\n

Radio

\n\nA representation of `st.radio`.\n\n```python\nat.radio[0].set_value(\"New York\").run()\n```\n\n
\n\n\n\n

SelectSlider

\n\nA representation of `st.select_slider`.\n\n```python\nat.select_slider[0].set_range(\"A\",\"C\").run()\n```\n\n
\n\n\n\n

Selectbox

\n\nA representation of `st.selectbox`.\n\n```python\nat.selectbox[0].select(\"New York\").run()\n```\n\n
\n\n\n\n

Slider

\n\nA representation of `st.slider`.\n\n```python\nat.slider[0].set_range(2,5).run()\n```\n\n
\n\n\n\n

TextArea

\n\nA representation of `st.text_area`.\n\n```python\nat.text_area[0].input(\"Streamlit is awesome!\").run()\n```\n\n
\n\n\n\n

TextInput

\n\nA representation of `st.text_input`.\n\n```python\nat.text_input[0].input(\"Streamlit\").run()\n```\n\n
\n\n\n\n

TimeInput

\n\nA representation of `st.time_input`.\n\n```python\nat.time_input[0].increment().run()\n```\n\n
\n\n\n\n

Toggle

\n\nA representation of `st.toggle`.\n\n```python\nat.toggle[0].set_value(\"True\").run()\n```\n\n
\n\n
\n\n\n\n\n\n\"screenshot\"\n\n

Pandas Profiling

\n\nPandas profiling component for Streamlit. Created by [@okld](https://github.com/okld/).\n\n```python\ndf = pd.read_csv(\"https://storage.googleapis.com/tf-datasets/titanic/train.csv\")\npr = df.profile_report()\n\nst_profile_report(pr)\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Ace

\n\nAce editor component for Streamlit. Created by [@okld](https://github.com/okld).\n\n```python\nfrom streamlit_ace import st_ace\n\ncontent = st_ace()\ncontent\n```\n\n
\n\n\n\n\"screenshot\"\n\n

Streamlit Analytics

\n\nTrack & visualize user interactions with your streamlit app. Created by [@jrieke](https://github.com/jrieke).\n\n```python\nimport streamlit_analytics\n\nwith streamlit_analytics.track():\n st.text_input(\"Write something\")\n```\n\n
\n\n
" - }, - { - "url": "https://docs.streamlit.io/develop/concepts", - "content": "# Development concepts\n\nThis section gives you background on how different parts of Streamlit work.\n\n\n\n\n\n
Streamlit's architecture and execution model
\n\nStreamlit's execution model makes it easy to turn your scripts into beautiful, interactive web apps.\n\n- Understand how to run your app.\n- Understand Streamlit's execution and client-server model.\n- Understand the primary tools to work with Streamlit reruns.\n\n
\n\n\n\n
Multipage apps
\n\nStreamlit provides an automated way to build multipage apps through directory structure.\n\n- Learn how to structure and configure your multipage app.\n\n
\n\n\n\n
App design considerations
\n\nBring together Streamlit's architecture and execution model to design your app. Work with Streamlit commands to render dynamic and\ninteractic content for your users.\n\n- Learn how to make your apps performant and easy-to-manage.\n- Learn how to structure and design your project.\n\n
\n\n\n\n
Connections and secrets
\n\n- Learn how to manage connections and secrets with Streamlit's convenient, built-in features.\n\n
\n\n\n\n
Creating custom components
\n\nCustom components extend Streamlit's functionality.\n\n- Learn how to build your own custom component.\n- Learn how install a third-party component.\n\n
\n\n\n\n
Configuration and theming
\n\nStreamlit provides a variety options to customize and configure your app.\n\n- Learn how to work with configuration options, including server settings, client settings, and theming.\n\n
\n\n\n\n
App testing
\n\nStreamlit app testing enables developers to build and run automated tests. Bring your favorite test automation software and enjoy simple syntax to simulate user input and inspect rendered output.\n\n
\n
" - }, - { - "url": "https://docs.streamlit.io/develop/tutorials", - "content": "# Tutorials\n\nOur tutorials include step-by-step examples of building different types of apps in Streamlit.\n\n\n\n\n\n
Add user authentication
\n\nAdd user authentication with Streamlit's built-in support for OpenID Connect.\n\n
\n\n\n\n
Chat apps and LLMs
\n\nWork with LLMs and create chat apps.\n\n
\n\n\n\n
Configuration and theming
\n\nCustomize the appearance of your app.\n\n
\n\n\n\n
Connect to data sources
\n\nConnect to popular datasources.\n\n
\n\n\n\n
Work with Streamlit's core elements
\n\nWork with core elements like dataframes and charts.\n\n
\n\n\n\n
Use core features to work with Streamlit's execution model
\n\nBuild simple apps and walk through examples to learn about Streamlit's core features and execution model.\n\n
\n\n\n\n
Create multipage apps
\n\nCreate multipage apps, navigation, and flows.\n\n
\n\n
\n\nWhen you're done developing your app, see our [deployment tutorials](/deploy/tutorials), too!" - }, - { - "url": "https://docs.streamlit.io/develop/quick-reference/prerelease", - "content": "# Pre-release features\n\nAt Streamlit, we like to move quick while keeping things stable. In our latest effort to move even faster without sacrificing stability, we're offering our bold and fearless users two ways to try out Streamlit's bleeding-edge features:\n\n1. [Experimental features](#experimental-features)\n2. [Nightly releases](#nightly-releases)\n\n## Experimental Features\n\nLess stable Streamlit features have one naming convention: `st.experimental_`. This distinction is a prefix we attach to our command names to make sure their status is clear to everyone.\n\nHere's a quick rundown of what you get from each naming convention:\n\n- **st**: this is where our core features like `st.write` and `st.dataframe` live. If we ever make backward-incompatible changes to these, they will take place gradually and with months of announcements and warnings.\n- **experimental**: this is where we'll put all new features that may or may not ever make it into Streamlit core. This gives you a chance to try the next big thing we're cooking up weeks or months before we're ready to stabilize its API. We don't know whether these features have a future, but we want you to have access to everything we're trying, and work with us to figure them out.\n\nFeatures with the `experimental_` naming convention are things that we're still working on or trying\nto understand. If these features are successful, at some point they'll become part of Streamlit\ncore. If unsuccessful, these features are removed without much notice. While in experimental, a feature's API and behaviors may not be stable, and it's possible they could change in ways that aren't backward-compatible.\n\n\n\nExperimental features and their APIs may change or be removed at any time.\n\n\n\n### The lifecycle of an experimental feature\n\n1. A feature is added with the `experimental_` prefix.\n2. The feature is potentially tweaked over time, with possible API/behavior breakages.\n3. If successful, we promote the feature to Streamlit core and remove it from `experimental_`:\n - a\\. The feature's API stabilizes and the feature is _cloned_ without the `experimental_` prefix, so it exists as both `st` and `experimental_`. At this point, users will see a warning when using the version of the feature with the `experimental_` prefix -- but the feature will still work.\n - b\\. At some point, the code of the `experimental_`-prefixed feature is _removed_, but there will still be a stub of the function prefixed with `experimental_` that shows an error with appropriate instructions.\n - c\\. Finally, at a later date the `experimental_` version is removed.\n4. If unsuccessful, the feature is removed without much notice and we leave a stub in `experimental_` that shows an error with instructions.\n\n## Nightly releases\n\nIn addition to experimental features, we offer another way to try out Streamlit's newest features: nightly releases.\n\nAt the end of each day (at night 🌛), our bots run automated tests against the latest Streamlit code and, if everything looks good, it publishes them as the `streamlit-nightly` package. This means the nightly build includes all our latest features, bug fixes, and other enhancements on the same day they land on our codebase.\n\n**How does this differ from official releases?**\n\nOfficial Streamlit releases go not only through both automated tests but also rigorous manual testing, while nightly releases only have automated tests. It's important to keep in mind that new features introduced in nightly releases often lack polish. In our official releases, we always make double-sure all new features are ready for prime time.\n\n**How do I use the nightly release?**\n\nAll you need to do is install the `streamlit-nightly` package:\n\n```bash\npip uninstall streamlit\npip install streamlit-nightly --upgrade\n```\n\n\n\nYou should never have both `streamlit` and `streamlit-nightly` installed in the same environment!\n\n\n\n**Why should I use the nightly release?**\n\nBecause you can't wait for official releases, and you want to help us find bugs early!\n\n**Why shouldn't I use the nightly release?**\n\nWhile our automated tests have high coverage, there's still a significant likelihood that there will be some bugs in the nightly code.\n\n**Can I choose which nightly release I want to install?**\n\nIf you'd like to use a specific version, you can find the version number in our [Release history](https://pypi.org/project/streamlit-nightly/#history). Specify the desired version using `pip` as usual: `pip install streamlit-nightly==x.yy.zz-123456`.\n\n**Can I compare changes between releases?**\n\nIf you'd like to review the changes for a nightly release, you can use the [comparison tool on GitHub](https://github.com/streamlit/streamlit/compare/0.57.3...0.57.4.dev20200412)." - }, - { - "url": "https://docs.streamlit.io/develop/quick-reference", - "content": "# Quick reference\n\n\n\n\n\n
Cheatsheet
\n\nA dense list of Streamlit commands with example syntax.\n\n
\n\n\n\n
Release notes
\n\nSee how Streamlit has changed with each new version.\n\n
\n\n\n\n
Pre-release features
\n\nUnderstand how we introduce new features and how you can get your hands on them sooner!\n\n
\n\n\n\n
Roadmap
\n\nGet a sneak peek at what we have scheduled for the next year.\n\n
\n\n
" - }, - { - "url": "https://docs.streamlit.io/develop/quick-reference/cheat-sheet", - "content": "# Streamlit API cheat sheet\n\nThis is a summary of the docs for the latest version of Streamlit, [v1.46.0](https://pypi.org/project/streamlit/1.46.0/).\n\n\n\n\n\n#### Install & Import\n\n```python\npip install streamlit\n\nstreamlit run first_app.py\n\n# Import convention\n>>> import streamlit as st\n```\n\n\n\n\n\n#### Pre-release features\n\n```python\npip uninstall streamlit\npip install streamlit-nightly --upgrade\n```\n\nLearn more about [experimental features](advanced-features/prerelease#experimental-features)\n\n\n\n\n\n#### Command line\n\n```python\nstreamlit cache clear\nstreamlit config show\nstreamlit docs\nstreamlit hello\nstreamlit help\nstreamlit init\nstreamlit run streamlit_app.py\nstreamlit version\n```\n\n\n\n\n\n\n\n\n\n#### Magic commands\n\n```python\n# Magic commands implicitly\n# call st.write().\n\"_This_ is some **Markdown**\"\nmy_variable\n\"dataframe:\", my_data_frame\n\n```\n\n\n\n\n\n#### Display text\n\n```python\nst.write(\"Most objects\") # df, err, func, keras!\nst.write([\"st\", \"is <\", 3])\nst.write_stream(my_generator)\nst.write_stream(my_llm_stream)\n\nst.text(\"Fixed width text\")\nst.markdown(\"_Markdown_\")\nst.latex(r\"\"\" e^{i\\pi} + 1 = 0 \"\"\")\nst.title(\"My title\")\nst.header(\"My header\")\nst.subheader(\"My sub\")\nst.code(\"for i in range(8): foo()\")\nst.badge(\"New\")\nst.html(\"

Hi!

\")\n```\n\n
\n\n\n\n#### Display data\n\n```python\nst.dataframe(my_dataframe)\nst.table(data.iloc[0:10])\nst.json({\"foo\":\"bar\",\"fu\":\"ba\"})\nst.metric(\"My metric\", 42, 2)\n\n```\n\n\n\n\n\n#### Display media\n\n```python\nst.image(\"./header.png\")\nst.audio(data)\nst.video(data)\nst.video(data, subtitles=\"./subs.vtt\")\nst.logo(\"logo.jpg\")\n```\n\n\n\n\n\n#### Display charts\n\n```python\nst.area_chart(df)\nst.bar_chart(df)\nst.bar_chart(df, horizontal=True)\nst.line_chart(df)\nst.map(df)\nst.scatter_chart(df)\n\nst.altair_chart(chart)\nst.bokeh_chart(fig)\nst.graphviz_chart(fig)\nst.plotly_chart(fig)\nst.pydeck_chart(chart)\nst.pyplot(fig)\nst.vega_lite_chart(df, spec)\n\n# Work with user selections\nevent = st.plotly_chart(\n df,\n on_select=\"rerun\"\n)\nevent = st.altair_chart(\n chart,\n on_select=\"rerun\"\n)\nevent = st.vega_lite_chart(\n df,\n spec,\n on_select=\"rerun\"\n)\n```\n\nTo use newer versions of Bokeh, see our custom component [`streamlit-bokeh`](https://github.com/streamlit/streamlit-bokeh).\n\n\n\n\n\n#### Add elements to sidebar\n\n```python\n# Just add it after st.sidebar:\na = st.sidebar.radio(\"Select one:\", [1, 2])\n\n# Or use \"with\" notation:\nwith st.sidebar:\n st.radio(\"Select one:\", [1, 2])\n```\n\n\n\n\n\n#### Columns\n\n```python\n# Two equal columns:\ncol1, col2 = st.columns(2)\ncol1.write(\"This is column 1\")\ncol2.write(\"This is column 2\")\n\n# Three different columns:\ncol1, col2, col3 = st.columns([3, 1, 1])\n# col1 is larger.\n\n# Bottom-aligned columns\ncol1, col2 = st.columns(2, vertical_alignment=\"bottom\")\n\n# You can also use \"with\" notation:\nwith col1:\n st.radio(\"Select one:\", [1, 2])\n```\n\n\n\n\n\n#### Tabs\n\n```python\n# Insert containers separated into tabs:\ntab1, tab2 = st.tabs([\"Tab 1\", \"Tab2\"])\ntab1.write(\"this is tab 1\")\ntab2.write(\"this is tab 2\")\n\n# You can also use \"with\" notation:\nwith tab1:\n st.radio(\"Select one:\", [1, 2])\n```\n\n\n\n\n\n#### Expandable containers\n\n```python\nexpand = st.expander(\"My label\", icon=\":material/info:\")\nexpand.write(\"Inside the expander.\")\npop = st.popover(\"Button label\")\npop.checkbox(\"Show all\")\n\n# You can also use \"with\" notation:\nwith expand:\n st.radio(\"Select one:\", [1, 2])\n```\n\n\n\n\n\n#### Control flow\n\n```python\n# Stop execution immediately:\nst.stop()\n# Rerun script immediately:\nst.rerun()\n# Navigate to another page:\nst.switch_page(\"pages/my_page.py\")\n\n# Define a navigation widget in your entrypoint file\npg = st.navigation(\n st.Page(\"page1.py\", title=\"Home\", url_path=\"home\", default=True)\n st.Page(\"page2.py\", title=\"Preferences\", url_path=\"settings\")\n)\npg.run()\n\n# Group multiple widgets:\nwith st.form(key=\"my_form\"):\n username = st.text_input(\"Username\")\n password = st.text_input(\"Password\")\n st.form_submit_button(\"Login\")\n\n# Define a dialog function\n@st.dialog(\"Welcome!\")\ndef modal_dialog():\n st.write(\"Hello\")\n\nmodal_dialog()\n\n# Define a fragment\n@st.fragment\ndef fragment_function():\n df = get_data()\n st.line_chart(df)\n st.button(\"Update\")\n\nfragment_function()\n```\n\n\n\n\n\n#### Display interactive widgets\n\n```python\nst.button(\"Click me\")\nst.download_button(\"Download file\", data)\nst.link_button(\"Go to gallery\", url)\nst.page_link(\"app.py\", label=\"Home\")\nst.data_editor(\"Edit data\", data)\nst.checkbox(\"I agree\")\nst.feedback(\"thumbs\")\nst.pills(\"Tags\", [\"Sports\", \"Politics\"])\nst.radio(\"Pick one\", [\"cats\", \"dogs\"])\nst.segmented_control(\"Filter\", [\"Open\", \"Closed\"])\nst.toggle(\"Enable\")\nst.selectbox(\"Pick one\", [\"cats\", \"dogs\"])\nst.multiselect(\"Buy\", [\"milk\", \"apples\", \"potatoes\"])\nst.slider(\"Pick a number\", 0, 100)\nst.select_slider(\"Pick a size\", [\"S\", \"M\", \"L\"])\nst.text_input(\"First name\")\nst.number_input(\"Pick a number\", 0, 10)\nst.text_area(\"Text to translate\")\nst.date_input(\"Your birthday\")\nst.time_input(\"Meeting time\")\nst.file_uploader(\"Upload a CSV\")\nst.audio_input(\"Record a voice message\")\nst.camera_input(\"Take a picture\")\nst.color_picker(\"Pick a color\")\n\n# Use widgets' returned values in variables:\nfor i in range(int(st.number_input(\"Num:\"))):\n foo()\nif st.sidebar.selectbox(\"I:\",[\"f\"]) == \"f\":\n b()\nmy_slider_val = st.slider(\"Quinn Mallory\", 1, 88)\nst.write(slider_val)\n\n# Disable widgets to remove interactivity:\nst.slider(\"Pick a number\", 0, 100, disabled=True)\n```\n\n\n\n\n\n#### Build chat-based apps\n\n```python\n# Insert a chat message container.\nwith st.chat_message(\"user\"):\n st.write(\"Hello 👋\")\n st.line_chart(np.random.randn(30, 3))\n\n# Display a chat input widget at the bottom of the app.\nst.chat_input(\"Say something\")\n\n# Display a chat input widget inline.\nwith st.container():\n st.chat_input(\"Say something\")\n```\n\nLearn how to [Build a basic LLM chat app](/develop/tutorials/llms/build-conversational-apps)\n\n\n\n\n\n#### Mutate data\n\n```python\n# Add rows to a dataframe after\n# showing it.\nelement = st.dataframe(df1)\nelement.add_rows(df2)\n\n# Add rows to a chart after\n# showing it.\nelement = st.line_chart(df1)\nelement.add_rows(df2)\n```\n\n\n\n\n\n#### Display code\n\n```python\nwith st.echo():\n st.write(\"Code will be executed and printed\")\n```\n\n\n\n\n\n#### Placeholders, help, and options\n\n```python\n# Replace any single element.\nelement = st.empty()\nelement.line_chart(...)\nelement.text_input(...) # Replaces previous.\n\n# Insert out of order.\nelements = st.container()\nelements.line_chart(...)\nst.write(\"Hello\")\nelements.text_input(...) # Appears above \"Hello\".\n\nst.help(pandas.DataFrame)\nst.get_option(key)\nst.set_option(key, value)\nst.set_page_config(layout=\"wide\")\nst.query_params[key]\nst.query_params.from_dict(params_dict)\nst.query_params.get_all(key)\nst.query_params.clear()\nst.html(\"

Hi!

\")\n```\n\n
\n\n\n\n#### Connect to data sources\n\n```python\nst.connection(\"pets_db\", type=\"sql\")\nconn = st.connection(\"sql\")\nconn = st.connection(\"snowflake\")\n\nclass MyConnection(BaseConnection[myconn.MyConnection]):\n def _connect(self, **kwargs) -> MyConnection:\n return myconn.connect(**self._secrets, **kwargs)\n def query(self, query):\n return self._instance.query(query)\n```\n\n\n\n\n\n#### Optimize performance\n\n###### Cache data objects\n\n```python\n# E.g. Dataframe computation, storing downloaded data, etc.\n@st.cache_data\ndef foo(bar):\n # Do something expensive and return data\n return data\n# Executes foo\nd1 = foo(ref1)\n# Does not execute foo\n# Returns cached item by value, d1 == d2\nd2 = foo(ref1)\n# Different arg, so function foo executes\nd3 = foo(ref2)\n# Clear the cached value for foo(ref1)\nfoo.clear(ref1)\n# Clear all cached entries for this function\nfoo.clear()\n# Clear values from *all* in-memory or on-disk cached functions\nst.cache_data.clear()\n```\n\n###### Cache global resources\n\n```python\n# E.g. TensorFlow session, database connection, etc.\n@st.cache_resource\ndef foo(bar):\n # Create and return a non-data object\n return session\n# Executes foo\ns1 = foo(ref1)\n# Does not execute foo\n# Returns cached item by reference, s1 == s2\ns2 = foo(ref1)\n# Different arg, so function foo executes\ns3 = foo(ref2)\n# Clear the cached value for foo(ref1)\nfoo.clear(ref1)\n# Clear all cached entries for this function\nfoo.clear()\n# Clear all global resources from cache\nst.cache_resource.clear()\n```\n\n\n\n\n\n#### Display progress and status\n\n```python\n# Show a spinner during a process\nwith st.spinner(text=\"In progress\"):\n time.sleep(3)\n st.success(\"Done\")\n\n# Show and update progress bar\nbar = st.progress(50)\ntime.sleep(3)\nbar.progress(100)\n\nwith st.status(\"Authenticating...\") as s:\n time.sleep(2)\n st.write(\"Some long response.\")\n s.update(label=\"Response\")\n\nst.balloons()\nst.snow()\nst.toast(\"Warming up...\")\nst.error(\"Error message\")\nst.warning(\"Warning message\")\nst.info(\"Info message\")\nst.success(\"Success message\")\nst.exception(e)\n```\n\n\n\n\n\n#### Personalize apps for users\n\n```python\n# Authenticate users\nif not st.user.is_logged_in:\n st.login(\"my_provider\")\nf\"Hi, {st.user.name}\"\nst.logout()\n\n# Get dictionaries of cookies, headers, locale, and browser data\nst.context.cookies\nst.context.headers\nst.context.ip_address\nst.context.is_embedded\nst.context.locale\nst.context.theme.type\nst.context.timezone\nst.context.timezone_offset\nst.context.url\n```\n\n\n
" - }, - { - "url": "https://docs.streamlit.io/develop/quick-reference/release-notes/2025", - "content": "# 2025 release notes\n\nThis page contains release notes for Streamlit versions released in 2025. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes).\n\n## **Version 1.46.0**\n\n_Release date: June 18, 2025_\n\n**Highlights**\n\n- 🧭 Introducing top navigation! Use [`st.navigation`](https://docs.streamlit.io/develop/api-reference/navigation/st.navigation) with `position=\"top\"` to create a navigation menu across the top of your app.\n- 🔆 You can detect if the viewer is in light mode or dark mode at runtime with [`st.context.theme`](https://docs.streamlit.io/develop/api-reference/caching-and-state/st.context#contexttheme).\n\n**Notable Changes**\n\n- 🪺 Streamlit no longer restricts the nesting of columns, expanders, popovers, and chat message containers, but beware of bad design! Always be mindful of different screen sizes and orientations, and don't overuse nested layouts.\n- ↔️ You can set the width of most Streamlit elements.\n- ⬆️ [`st.form`](https://docs.streamlit.io/develop/api-reference/execution-flow/st.form) has a new parameter to configure its `height`.\n- 🛠️ [`st.columns`](https://docs.streamlit.io/develop/api-reference/layout/st.columns) supports `gap=None` for no gap between columns.\n- 🏋️ Font face declarations in [`config.toml`](https://docs.streamlit.io/develop/api-reference/configuration/config.toml#theme) support weight and unicode ranges ([#11248](https://github.com/streamlit/streamlit/pull/11248), [#11163](https://github.com/streamlit/streamlit/issues/11163), [#11247](https://github.com/streamlit/streamlit/issues/11247)).\n- 😃 Font face declarations are supported in the window variable ([#11628](https://github.com/streamlit/streamlit/pull/11628), [#11568](https://github.com/streamlit/streamlit/issues/11568)).\n- 🔎 Streamlit searches for secrets and configuration options relative to the entrypoint file in addition to the working directory and user root ([#10173](https://github.com/streamlit/streamlit/pull/10173), [#8195](https://github.com/streamlit/streamlit/issues/8195)).\n- 🎨 A new configuration option, `theme.dataframeBorderColor`, lets you set the border color for dataframes and tables separately from other border colors ([#11475](https://github.com/streamlit/streamlit/pull/11475)).\n- 🌯 A new configuration option, `theme.buttonRadius`, lets you set the radius of buttons separately from other elements ([#11464](https://github.com/streamlit/streamlit/pull/11464)).\n- 🖥️ A new configuration option, `theme.codeFontSize`, lets you set the size of code in `st.code`, `st.json`, and `st.help` ([#11508](https://github.com/streamlit/streamlit/pull/11508)).\n- 🔒 You can configure a list of allowed origins when CORS protection is enabled ([#11377](https://github.com/streamlit/streamlit/pull/11377)).\n- 📄 `st.set_page_config` can be called multiple times in a single script run ([#11286](https://github.com/streamlit/streamlit/pull/11286), [#4483](https://github.com/streamlit/streamlit/issues/4483), [#2216](https://github.com/streamlit/streamlit/issues/2216), [#9797](https://github.com/streamlit/streamlit/issues/9797), [#9038](https://github.com/streamlit/streamlit/issues/9038)).\n- 🗺️ `st.pydeck_chart` and [`st.map`](http://st.map) now use Carto by default to provide map tiles ([#11231](https://github.com/streamlit/streamlit/pull/11231)).\n- 👀 You can configure Streamlit to watch additional directories for changes with the new configuration option, `server.folderWatchList` ([#9656](https://github.com/streamlit/streamlit/pull/9656), [#9655](https://github.com/streamlit/streamlit/issues/9655)). Thanks, [akramsystems](https://github.com/akramsystems)!\n\n**Other Changes**\n\n- 🔘 Exception messages include a copy button to conveniently copy the message to your clipboard ([#11250](https://github.com/streamlit/streamlit/pull/11250), [#11083](https://github.com/streamlit/streamlit/issues/11083)). Thanks, [snakeM](https://github.com/snakeM)!\n- ⚓ Streamlit apps can be served from port 3000 ([#11525](https://github.com/streamlit/streamlit/pull/11525), [#8149](https://github.com/streamlit/streamlit/issues/8149)).\n- 👟 Markdown dependencies were upgraded for improved performance ([#11553](https://github.com/streamlit/streamlit/pull/11553), [#11550](https://github.com/streamlit/streamlit/issues/11550)).\n- ↔️ The sidebar is narrower by default and consistently handles the scrollbar spacing ([#11412](https://github.com/streamlit/streamlit/pull/11412)).\n- 👋 We gave Streamlit hello a couple small tweaks ([#11442](https://github.com/streamlit/streamlit/pull/11442)).\n- 🧑‍💻 Base URL window variables are consistently namespaced in `__streamlit` ([#11481](https://github.com/streamlit/streamlit/pull/11481)).\n- 🌐 Streamlit apps now serve a `manifest.json` file ([#11462](https://github.com/streamlit/streamlit/pull/11462)).\n- 🖌️ `st.dataframe` shows row selection boxes always instead of just on hover ([#11411](https://github.com/streamlit/streamlit/pull/11411), [#11410](https://github.com/streamlit/streamlit/issues/11410)).\n- 🦋 `ListColumn` and `LinkColumn` can inherit coloring from `pandas` `Styler` ([#11612](https://github.com/streamlit/streamlit/pull/11612), [#8254](https://github.com/streamlit/streamlit/issues/8254)).\n- 💹 `NumberColumn` and `ProgressColumn` support a Japanese yen number format ([#11588](https://github.com/streamlit/streamlit/pull/11588)). Thanks, [alexmalins](https://github.com/alexmalins)!\n- 🔗 `st.page_link` can inherit an icon when passed a `StreamlitPage` ([#10694](https://github.com/streamlit/streamlit/pull/10694), [#9743](https://github.com/streamlit/streamlit/issues/9743)). Thanks, [abokey1](https://github.com/abokey1)!\n- 🎫 A button's placement in the sidebar or main body of an app is included in its widget identity ([#10881](https://github.com/streamlit/streamlit/pull/10881), [#10598](https://github.com/streamlit/streamlit/issues/10598)). Thanks, [joaooliveira-11](https://github.com/joaooliveira-11)!\n- 🕷️ Built-in Streamlit fonts now use variable font files ([#11646](https://github.com/streamlit/streamlit/pull/11646), [#11600](https://github.com/streamlit/streamlit/pull/11600), [#11534](https://github.com/streamlit/streamlit/pull/11534)).\n- 🤹 Bug fix: Streamlit Markdown correctly formats task lists and block quotes (#11237).\n- 🐞 Bug fix: Horizontal scroll bars are sized correctly in Safari ([#11625](https://github.com/streamlit/streamlit/pull/11625)).\n- 🐝 Bug fix: Unnecessary media caching was reduced to improve efficiency and avoid video player crashes ([#11635](https://github.com/streamlit/streamlit/pull/11635), [#9688](https://github.com/streamlit/streamlit/issues/9688)).\n- 🐜 Bug fix: `st.text` uses the `break-word` CSS property to wrap long lines without whitespace ([#10969](https://github.com/streamlit/streamlit/pull/10969), [#10824](https://github.com/streamlit/streamlit/issues/10824)). Thanks, [matilde2004](https://github.com/matilde2004)!\n- 🪲 Bug fix: Material icons display correctly in `st.markdown` when `unsafe_allow_html=True` ([#11633](https://github.com/streamlit/streamlit/pull/11633), [#9945](https://github.com/streamlit/streamlit/issues/9945)).\n- 🐛 Bug fix: Multi-index column names preserve brackets ([#11617](https://github.com/streamlit/streamlit/pull/11617), [#10415](https://github.com/streamlit/streamlit/issues/10415)).\n- 💅 Bug fix: Various CSS tweaks ([#11631](https://github.com/streamlit/streamlit/pull/11631), [#11632](https://github.com/streamlit/streamlit/pull/11632), [#11630](https://github.com/streamlit/streamlit/pull/11630), [#11611](https://github.com/streamlit/streamlit/issues/11611), [#11577](https://github.com/streamlit/streamlit/pull/11577), [#9085](https://github.com/streamlit/streamlit/issues/9085), [#8671](https://github.com/streamlit/streamlit/issues/8671), [#11576](https://github.com/streamlit/streamlit/pull/11576), [#11569](https://github.com/streamlit/streamlit/issues/11569)).\n- ⛏️ Bug fix: `st.dataframe` clears filter options when applying sort to prevent incorrect highlights ([#11587](https://github.com/streamlit/streamlit/pull/11587), [#11575](https://github.com/streamlit/streamlit/issues/11575)).\n- 📊 Bug fix: Altair charts have the correct width and don't overflow with long titles ([#11585](https://github.com/streamlit/streamlit/pull/11585), [#9984](https://github.com/streamlit/streamlit/issues/9984)).\n- 🍞 Bug fix: `st.toast` messages appear above `st.dialog` containers ([#11578](https://github.com/streamlit/streamlit/pull/11578), [#10383](https://github.com/streamlit/streamlit/issues/10383)).\n- 🪱 Bug fix: Streamlit apps correctly scroll to anchor links ([#11552](https://github.com/streamlit/streamlit/pull/11552), [#11551](https://github.com/streamlit/streamlit/issues/11551)).\n- ✍️ Bug fix: `st.context` does not lose state in an app being edited ([#11506](https://github.com/streamlit/streamlit/pull/11506), [#11330](https://github.com/streamlit/streamlit/issues/11330)).\n- ⬜ Bug fix: `st.code` preserves leading white space ([#10065](https://github.com/streamlit/streamlit/pull/10065), [#6302](https://github.com/streamlit/streamlit/issues/6302)). Thanks, [XuehaiPan](https://github.com/XuehaiPan)!\n- 📅 Bug fix: `st.date_input` shows the correct hover effect when using date ranges ([#11223](https://github.com/streamlit/streamlit/pull/11223), [#10929](https://github.com/streamlit/streamlit/issues/10929)). Thanks, [Bernardo1008](https://github.com/Bernardo1008)!\n- 💩 Bug fix: Dataframes using `pandas` `Styler` correctly display `Enum` values ([#11049](https://github.com/streamlit/streamlit/pull/11049), [#10637](https://github.com/streamlit/streamlit/issues/10637)). Thanks, [BigBird404](https://github.com/BigBird404)!\n- ☠️ Bug fix: `st.context` does not lose state when `st.switch_page` is called ([#11521](https://github.com/streamlit/streamlit/pull/11521), [#11507](https://github.com/streamlit/streamlit/issues/11507)).\n- 👽 Bug fix: File watcher correctly handles custom metaclasses ([#10388](https://github.com/streamlit/streamlit/pull/10388), [#10992](https://github.com/streamlit/streamlit/issues/10992)). Thanks, [HomenShum](https://github.com/HomenShum)!\n- 👻 Bug fix: [`st.map`](http://st.map) uses a private Mapbox token when configured ([#11511](https://github.com/streamlit/streamlit/pull/11511), [#11399](https://github.com/streamlit/streamlit/issues/11399)).\n- 🦀 Bug fix: `vega-interpreter` was updated to prevent unintentional blank axes ([#11514](https://github.com/streamlit/streamlit/pull/11514), [#5733](https://github.com/streamlit/streamlit/issues/5733)).\n- 🦎 Bug fix: Truncated values in `NumberColumn` are rounded correctly ([#11520](https://github.com/streamlit/streamlit/pull/11520), [#11519](https://github.com/streamlit/streamlit/issues/11519)).\n- 🐌 Bug fix: Highlighted in text in Markdown has the correct padding on wrapped lines ([#11530](https://github.com/streamlit/streamlit/pull/11530)).\n- 🕸️ Bug fix: For a Plotly chart, reset axes works correctly after using fullscreen ([#11498](https://github.com/streamlit/streamlit/pull/11498), [#11327](https://github.com/streamlit/streamlit/issues/11327)).\n- 🦗 Bug fix: Altair chart are not cropped on the left on first load ([#10939](https://github.com/streamlit/streamlit/pull/10939), [#9339](https://github.com/streamlit/streamlit/issues/9339)). Thanks, [goncalossmartins](https://github.com/goncalossmartins)!\n- 📈 Bug fix: Chart columns correctly show negative values ([#11048](https://github.com/streamlit/streamlit/pull/11048), [#10411](https://github.com/streamlit/streamlit/issues/10411)). Thanks, [tiagorb1](https://github.com/tiagorb1)!\n- 🦂 Bug fix: Streamlit doesn't crash when editing indices in `st.data_editor` ([#11448](https://github.com/streamlit/streamlit/pull/11448), [#11434](https://github.com/streamlit/streamlit/issues/11434)).\n- 🦟 Bug fix: Color and style is preserved in charts when using `.add_rows()` ([#11414](https://github.com/streamlit/streamlit/pull/11414), [#11312](https://github.com/streamlit/streamlit/issues/11312)).\n- 🌪️ Bug fix: Tornado 6.5.0 is excluded to prevent file uploading errors related to unicode filenames ([#11440](https://github.com/streamlit/streamlit/pull/11440), [#11396](https://github.com/streamlit/streamlit/issues/11396), [#11436](https://github.com/streamlit/streamlit/issues/11436)).\n- 🦠 Bug fix: Selected rows are cleared when a column in `st.dataframe` is sorted ([#11363](https://github.com/streamlit/streamlit/pull/11363), [#11345](https://github.com/streamlit/streamlit/issues/11345)).\n- 📶 Bug fix: Streamlit shows a clearer message when it can't connect to the server and automatically dismisses the message if a connection is successful ([#11366](https://github.com/streamlit/streamlit/pull/11366)).\n- 🪰 Bug fix: Localized number and date formats correctly interpret locales with commas ([#11297](https://github.com/streamlit/streamlit/pull/11297), [#11291](https://github.com/streamlit/streamlit/issues/11291)).\n- 🧹 Bug fix: Streamlit cleans up the forward message cache to prevent WebSocket message errors ([#11302](https://github.com/streamlit/streamlit/pull/11302), [#11299](https://github.com/streamlit/streamlit/issues/11299), [#11300](https://github.com/streamlit/streamlit/issues/11300)).\n- 📜 Bug fix: `st.latex` scrolls horizontally when its content is wider than the app ([#10071](https://github.com/streamlit/streamlit/pull/10071), [#4304](https://github.com/streamlit/streamlit/issues/4304)).\n- 🪳 Bug fix: `st.multiselect` has a more stable sort when filtering options ([#11309](https://github.com/streamlit/streamlit/pull/11309), [#11218](https://github.com/streamlit/streamlit/issues/11218)).\n- 🕷️ Bug fix: `st.multiselect` options are case sensitive and don't overlap in the drop down menu ([#11307](https://github.com/streamlit/streamlit/pull/11307), [#11217](https://github.com/streamlit/streamlit/issues/11217), [#11306](https://github.com/streamlit/streamlit/pull/11306), [#11215](https://github.com/streamlit/streamlit/issues/11215)).\n- 🍪 Bug fix: Streamlit logs an error if the cookie returned by `st.login` is too large ([#11290](https://github.com/streamlit/streamlit/pull/11290), [#11168](https://github.com/streamlit/streamlit/issues/11168)).\n- 🪲 Bug fix: Displaying elements within a fragment's callback logs a clear warning that it's not supported ([#10942](https://github.com/streamlit/streamlit/pull/10942), [#10475](https://github.com/streamlit/streamlit/issues/10475)). Thanks, [Zane-dev16](https://github.com/Zane-dev16)!\n- 🐞 Bug fix: `st.file_uploader` is case insensitive when validating allowed file extensions ([#11261](https://github.com/streamlit/streamlit/pull/11261), [#11259](https://github.com/streamlit/streamlit/issues/11259)).\n- 🐝 Bug fix: Page runs end correctly to prevent invalid widget states ([#11258](https://github.com/streamlit/streamlit/pull/11258), [#11202](https://github.com/streamlit/streamlit/issues/11202)).\n- 👤 Bug fix: Error messages correctly refer to `st.user` instead of `st.experimental_user` ([#11198](https://github.com/streamlit/streamlit/pull/11198)).\n- 🏷️ Bug fix: The missing label warning for widgets includes a stack trace ([#11187](https://github.com/streamlit/streamlit/pull/11187), [#8908](https://github.com/streamlit/streamlit/issues/8908)).\n- 🐛 Bug fix: `st.data_editor` returns the correct result when some rows are deleted and others are added ([#11183](https://github.com/streamlit/streamlit/pull/11183), [#11180](https://github.com/streamlit/streamlit/issues/11180)).\n\n## **Version 1.45.0**\n\n_Release date: April 29, 2025_\n\n**Highlights**\n\n- 🧑 Announcing the general availability of [`st.user`](https://docs.streamlit.io/develop/api-reference/user/st.user), a dict-like object to access information about the current user.\n\n**Notable Changes**\n\n- ➕ [`st.multiselect`](https://docs.streamlit.io/develop/api-reference/widgets/st.multiselect) and [`st.selectbox`](https://docs.streamlit.io/develop/api-reference/widgets/st.selectbox) have a new parameter to let users add new options.\n- 🥸 [`st.context`](https://docs.streamlit.io/develop/api-reference/caching-and-state/st.context) has new attributes: `url`, `ip_address`, and `is_embedded`.\n- ⚠️ Text [alerts](https://docs.streamlit.io/develop/api-reference/status/st.success) and [exceptions](https://docs.streamlit.io/develop/api-reference/status/st.exception) have a new `width` parameter ([#11142](https://github.com/streamlit/streamlit/pull/11142)).\n- ⌨️ You can set the tab index for [`st.components.v1.html`](https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v1.html) and [`st.components.v1.iframe`](https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v1.iframe) ([#11065](https://github.com/streamlit/streamlit/pull/11065), [#7969](https://github.com/streamlit/streamlit/issues/7969)).\n- 🌐 When you pass a CSS file's path to [`st.html`](https://docs.streamlit.io/develop/api-reference/text/st.html), Streamlit will automatically insert ` - ---- - -# 2025 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2025 - - -This page contains release notes for Streamlit versions released in 2025. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## **Version 1.45.0** - -_Release date: April 29, 2025_ - -**Highlights** - -- 🧑 Announcing the general availability of [`st.user`](https://docs.streamlit.io/develop/api-reference/user/st.user), a dict-like object to access information about the current user. - -**Notable Changes** - -- ➕ [`st.multiselect`](https://docs.streamlit.io/develop/api-reference/widgets/st.multiselect) and [`st.selectbox`](https://docs.streamlit.io/develop/api-reference/widgets/st.selectbox) have a new parameter to let users add new options. -- 🥸 [`st.context`](https://docs.streamlit.io/develop/api-reference/caching-and-state/st.context) has new attributes: `url`, `ip_address`, and `is_embedded`. -- ⚠️ Text [alerts](https://docs.streamlit.io/develop/api-reference/status/st.success) and [exceptions](https://docs.streamlit.io/develop/api-reference/status/st.exception) have a new `width` parameter ([#11142](https://github.com/streamlit/streamlit/pull/11142)). -- ⌨️ You can set the tab index for [`st.components.v1.html`](https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v1.html) and [`st.components.v1.iframe`](https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v1.iframe) ([#11065](https://github.com/streamlit/streamlit/pull/11065), [#7969](https://github.com/streamlit/streamlit/issues/7969)). -- 🌐 When you pass a CSS file's path to [`st.html`](https://docs.streamlit.io/develop/api-reference/text/st.html), Streamlit will automatically insert ` - ---- - -# 2024 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2024 - - -This page contains release notes for Streamlit versions released in 2024. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## **Version 1.41.0** - -_Release date: December 10, 2024_ - -**Notable Changes** - -- 🔲 [`st.metric`](/develop/api-reference/data/st.metric) and [`st.columns`](/develop/api-reference/layout/st.columns) have a parameter to show an optional border ([#9927](https://github.com/streamlit/streamlit/pull/9927), [#9928](https://github.com/streamlit/streamlit/pull/9928)). -- 🎨 Text and background color in [Markdown](/develop/api-reference/text/st.markdown) can use the "primary" color from the `theme.primaryColor` configuration option ([#9676](https://github.com/streamlit/streamlit/pull/9676)). -- 🥶 You can freeze columns with [column configuration](/develop/api-reference/data/st.column_config) to make them always visible when scrolling horizontally ([#9535](https://github.com/streamlit/streamlit/pull/9535), [#7078](https://github.com/streamlit/streamlit/issues/7078)). -- 3️⃣ The `type` parameter for [buttons](/develop/api-reference/widgets/st.button) accepts a new option, `"tertiary"` ([#9923](https://github.com/streamlit/streamlit/pull/9923)). -- 🚶‍♂️ Streamlit supports `pathlib.Path` objects everywhere you can use a string path ([#9711](https://github.com/streamlit/streamlit/pull/9711), [#9783](https://github.com/streamlit/streamlit/pull/9783)). -- ⏱️ [`st.date_input`](/develop/api-reference/widgets/st.date_input) and [`st.time_input`](/develop/api-reference/widgets/st.time_input) accept ISO formatted strings for initial values ([#9753](https://github.com/streamlit/streamlit/pull/9753)). -- 💬 [`st.write_stream`](/develop/api-reference/write-magic/st.write_stream) accepts async generators, which it converts internally to sync generators ([#8724](https://github.com/streamlit/streamlit/pull/8724), [#8161](https://github.com/streamlit/streamlit/issues/8161)). -- 🪵 The [`client.showErrorDetails`](/develop/api-reference/configuration/config.toml#client) configuration option has additional values to show or hide more information ([#9909](https://github.com/streamlit/streamlit/pull/9909)). -- 🔎 When Streamlit shows stack traces in the app for uncaught exceptions, internal code is omitted or reduced for easier debugging ([#9913](https://github.com/streamlit/streamlit/pull/9913)). -- 📈 [`st.line_chart`](/develop/api-reference/charts/st.line_chart) shows tooltips for the nearest point on hover ([#9674](https://github.com/streamlit/streamlit/pull/9674)). -- 🌐 [`st.html`](/develop/api-reference/utilities/st.html) will attempt to convert non-string objects with `._repr_html_()` before falling back to `str()` ([#9877](https://github.com/streamlit/streamlit/pull/9877)). -- 🐍 Streamlit supports Python 3.13 and no longer supports Python 3.8 ([#9635](https://github.com/streamlit/streamlit/pull/9635)). - -**Other Changes** - -- 🔣 Material Symbols have been updated with the latest icons ([#9813](https://github.com/streamlit/streamlit/pull/9813), [#9810](https://github.com/streamlit/streamlit/issues/9810)). -- 👽 Streamlit supports Watchdog version 6 ([#9785](https://github.com/streamlit/streamlit/pull/9785)). Thanks, [RubenVanEldik](https://github.com/RubenVanEldik). -- 🌀 Bug fix: Streamlit only shows cached function spinners on cache misses and doesn't show spinners for nested cached functions ([#9956](https://github.com/streamlit/streamlit/pull/9956), [#9951](https://github.com/streamlit/streamlit/issues/9951)). -- 🔈 Bug fix: Streamlit's audio buffer handles channels better to correctly play audio recordings in Firefox ([#9885](https://github.com/streamlit/streamlit/pull/9885), [#9799](https://github.com/streamlit/streamlit/issues/9799)). -- 🦊 Bug fix: URL patterns are matched correctly to allow Community Cloud developer tools to display correctly in Firefox ([#9849](https://github.com/streamlit/streamlit/pull/9849), [#9848](https://github.com/streamlit/streamlit/issues/9848)). -- ☠️ Bug fix: Corrected a performance and alignment problem with containers ([#9901](https://github.com/streamlit/streamlit/pull/9901), [#9456](https://github.com/streamlit/streamlit/issues/9456), [#9560](https://github.com/streamlit/streamlit/issues/9560)). -- 👻 Bug fix: `st.rerun` will raise an error if an invalid `scope` is passed to it ([#9911](https://github.com/streamlit/streamlit/pull/9911), [#9908](https://github.com/streamlit/streamlit/issues/9908)). -- 🦋 Bug fix: Dataframe toolbars show correctly in dialogs ([#9897](https://github.com/streamlit/streamlit/pull/9897), [#9461](https://github.com/streamlit/streamlit/issues/9461)). -- 🦀 Bug fix: `LinkColumn` regex for `display_text` uses the correct URI decoding ([#9895](https://github.com/streamlit/streamlit/pull/9895), [#9893](https://github.com/streamlit/streamlit/issues/9893)). -- 🦎 Bug fix: `st.dataframe` has correct type hinting when `on_selection="ignore"` ([#9898](https://github.com/streamlit/streamlit/pull/9898), [#9669](https://github.com/streamlit/streamlit/issues/9669)). -- 🐌 Bug fix: Padding is applied consistently for wide and centered layout mode ([#9882](https://github.com/streamlit/streamlit/pull/9882), [#9707](https://github.com/streamlit/streamlit/issues/9707)). -- 🕸️ Bug fix: `st.graphviz_chart` is displayed correctly when `use_container_width=True` ([#9867](https://github.com/streamlit/streamlit/pull/9867), [#9866](https://github.com/streamlit/streamlit/issues/9866)). -- 🦗 Bug fix: The overloaded definitions of `st.pills` and `st.segmented_control` use the correct selection-mode default ([#9801](https://github.com/streamlit/streamlit/pull/9801)). Thanks, [RubenVanEldik](https://github.com/RubenVanEldik)! -- 🦂 Bug fix: `st.text_area` (and other widgets) are correctly submitted in a form when using `Ctrl+Enter` ([#9847](https://github.com/streamlit/streamlit/pull/9847), [#9841](https://github.com/streamlit/streamlit/issues/9841)). -- 🦟 Bug Fix: `st.write` renders `DeltaGenerator` objects with [`st.help`](http://st.help) ([#9828](https://github.com/streamlit/streamlit/pull/9828), [#9827](https://github.com/streamlit/streamlit/issues/9827)). -- 🦠 Bug fix: `st.text_area` correctly matches the value in Session State when used with a key ([#9829](https://github.com/streamlit/streamlit/pull/9829), [#9825](https://github.com/streamlit/streamlit/issues/9825)). -- 🪰 Bug fix: `st.text_input` does not trigger a rerun when a user submits an unchanged value ([#9826](https://github.com/streamlit/streamlit/pull/9826)). -- 🪳 Bug fix: Improved styling for `st.exception` to fix overflow and incorrect padding ([#9818](https://github.com/streamlit/streamlit/pull/9818), [#9817](https://github.com/streamlit/streamlit/issues/9817), [#9816](https://github.com/streamlit/streamlit/issues/9816)). -- 🕷️ Bug fix: Large dataframe don't overflow and cover the dataframe toolbar in fullscreen mode ([#9803](https://github.com/streamlit/streamlit/pull/9803), [#9798](https://github.com/streamlit/streamlit/issues/9798)). -- 🐞 Bug fix: `st.audio_input` shows the correct time on recording in time zones with a half-hour offset ([#9791](https://github.com/streamlit/streamlit/pull/9791), [#9631](https://github.com/streamlit/streamlit/issues/9631)). -- 🐝 Bug fix: In iOS, `st.number_input` shows a number pad instead of a keyboard when in focus ([#9766](https://github.com/streamlit/streamlit/pull/9766), [#9763](https://github.com/streamlit/streamlit/issues/9763)). -- 🐜 Bug fix: Widget keys containing hyphens are correctly added to HTML classes in the DOM with an `st-key-` prefix ([#9793](https://github.com/streamlit/streamlit/pull/9793)). -- 🪲 Bug fix: Audio files created by `st.audio_input` include a timestamp to ensure unique file names ([#9768](https://github.com/streamlit/streamlit/pull/9768)). -- 🐛 Bug fix: Double slash URL pathnames do not create a 301 redirect ([#9754](https://github.com/streamlit/streamlit/pull/9754), [#9690](https://github.com/streamlit/streamlit/issues/9690)). - -## **Version 1.40.0** - -_Release date: November 6, 2024_ - -**Highlights** - -- 💊 Introducing [`st.pills`](/develop/api-reference/widgets/st.pills) to create a single- or multi-select group of pill-buttons. -- 🎛️ Introducing [`st.segmented_control`](/develop/api-reference/widgets/st.segmented_control) to create a segmented button or button group. -- 🎤 Announcing the general availability of [`st.audio_input`](), a widget to let users record sound with their microphones. - -**Notable Changes** - -- ➡️ Markdown renders a limited set of typographical symbols (arrows and comparators). -- {{ display: "inline-block", width: "1em" }} /> You can use `:streamlit:` to render the Streamlit logo in [Markdown](/develop/api-reference/text/st.markdown). -- 🐍 [`st.text`](/develop/api-reference/text/st.text) wraps text and no longer uses monospace font. -- 🪣 You can set `use_container_width` for [`st.image`](/develop/api-reference/media/st.image). `use_column_width` is deprecated. -- 📅 [`st.date_input`](/develop/api-reference/widgets/st.date_input) infers the first day of the week from the user’s locale ([#9706](https://github.com/streamlit/streamlit/pull/9706), [#5215](https://github.com/streamlit/streamlit/issues/5215)). - -**Other Changes** - -- 🎶 Streamlit’s CLI tool accepts array values for configuration options ([#9577](https://github.com/streamlit/streamlit/pull/9577)). -- ⛓️ Static file serving supports symlinks ([#9147](https://github.com/streamlit/streamlit/pull/9147), [#9146](https://github.com/streamlit/streamlit/issues/9146)). Thanks, [link89](https://github.com/link89)! -- 🚀 Streamlit provides helpful links for deployment when an app is running locally ([#9681](https://github.com/streamlit/streamlit/pull/9681)). -- ↕️ The fullscreen button for charts matches with the dataframe toolbar ([#9721](https://github.com/streamlit/streamlit/pull/9721)). -- 🏃 The running-man icon has a brief delay before rendering to avoid an unnecessary flicker for fast running apps ([#9732](https://github.com/streamlit/streamlit/pull/9732)). -- 🖇️ The `ComponentRequestHandler` allows symlinks ([#9588](https://github.com/streamlit/streamlit/pull/9588)). -- 👆 Streamlit works with `pillow` version 11 ([#9742](https://github.com/streamlit/streamlit/pull/9742)). Thanks, [hauntsaninja](https://github.com/hauntsaninja)! -- 🗺️ Deck.gl was upgraded to version 9.0.33 ([#9636](https://github.com/streamlit/streamlit/pull/9636)). -- 🦠 Bug fix: `st.latex` stays center-aligned when using the `help` keyword argument ([#9698](https://github.com/streamlit/streamlit/pull/9698), [#9682](https://github.com/streamlit/streamlit/issues/9682)). Thanks, [emmagarr](https://github.com/emmagarr)! -- 🪰 Bug fix: Apps correctly access local storage on Android ([#9744](https://github.com/streamlit/streamlit/pull/9744), [#9740](https://github.com/streamlit/streamlit/issues/9740)). -- 🕷️ Bug fix: Cached class methods can be cleared ([#9642](https://github.com/streamlit/streamlit/pull/9642), [#9633](https://github.com/streamlit/streamlit/issues/9633)). -- 🐞 Bug fix: Streamlit clears fragment auto-reruns when a user changes pages. This prevents an invalid index ([#9617](https://github.com/streamlit/streamlit/pull/9617)). -- 🐝 Bug fix: `st.page_link` margins are correct ([#9625](https://github.com/streamlit/streamlit/pull/9625)). -- 🐜 Bug fix: Form widgets show submission instructions when in focus ([#9576](https://github.com/streamlit/streamlit/pull/9576), [#7079](https://github.com/streamlit/streamlit/issues/7079)). -- 🪲 Bug fix: `st.navigation` correctly reconciles `client.showSidebarNavigation` ([#9589](https://github.com/streamlit/streamlit/pull/9589), [#9581](https://github.com/streamlit/streamlit/issues/9581)). -- 🐛 Bug fix: `st.text_area` requires a minimum height of 68px which fits two lines ([#9561](https://github.com/streamlit/streamlit/pull/9561), [#9217](https://github.com/streamlit/streamlit/issues/9217)). -- 💅 Bug fix: Various styling fixes ([#9529](https://github.com/streamlit/streamlit/pull/9529), [#8131](https://github.com/streamlit/streamlit/issues/8131), [#9555](https://github.com/streamlit/streamlit/pull/9555), [#9496](https://github.com/streamlit/streamlit/issues/9496), [#9554](https://github.com/streamlit/streamlit/pull/9554), [#9349](https://github.com/streamlit/streamlit/issues/9349), [#7739](https://github.com/streamlit/streamlit/issues/7739)). - -## **Version 1.39.0** - -_Release date: October 1, 2024_ - -**Highlights** - -- 🎤 Introducing [`st.experimental_audio_input`](/develop/api-reference/widgets/st.audio_input) to let users record with their microphones! -- 📍 [`st.pydeck_chart`](/develop/api-reference/charts/st.pydeck_chart#chart-selections) can return selection events! - -**Notable Changes** - -- 😃 [`st.button`](/develop/api-reference/widgets/st.button), [`st.download_button`](/develop/api-reference/widgets/st.download_button), [`st.form_submit_button`](/develop/api-reference/execution-flow/st.form_submit_button), [`st.link_button`](/develop/api-reference/widgets/st.link_button), and [`st.popover`](/develop/api-reference/layout/st.popover) each have a new parameter to add an icon. -- 🏢 [`st.logo`](/develop/api-reference/media/st.logo) has a new parameter to adjust the size of your logo. -- 🧭 [`st.navigation`](/develop/api-reference/navigation/st.navigation) lets you display an always-expanded or collapsible menu using a new `expanded` parameter. -- ↕️ You can set `height` and `width` for [`st.map`](/develop/api-reference/charts/st.map) and [`st.pydeck_chart`](/develop/api-reference/charts/st.pydeck_chart). -- ↩️ Form submission behavior can be configured with a new `enter_to_submit` parameter ([#9480](https://github.com/streamlit/streamlit/pull/9480), [#7538](https://github.com/streamlit/streamlit/issues/7538), [#9406](https://github.com/streamlit/streamlit/pull/9406), [#8042](https://github.com/streamlit/streamlit/issues/8042)). -- ⏱️ A new config option, `server.disconnectedSessionTTL`, lets you set a minimum time before a disconnected session is cleaned up ([#9179](https://github.com/streamlit/streamlit/pull/9179)). -- 🤹 Dataframes support multi-index headers ([#9483](https://github.com/streamlit/streamlit/pull/9483), [#6319](https://github.com/streamlit/streamlit/issues/6319)). - -**Other Changes** - -- 🔑 Widget keys appear as HTML classes in the DOM with an `st-key-` prefix ([#9295](https://github.com/streamlit/streamlit/pull/9295), [#5437](https://github.com/streamlit/streamlit/issues/5437), [#3888](https://github.com/streamlit/streamlit/issues/3888)). -- 🔍 The `StreamlitAPIException` class has been extended into more specific exceptions for some of the most common errors ([#9318](https://github.com/streamlit/streamlit/pull/9318)). -- 🗺️ `st.map` and `st.pydeck_chart` have a full-screen toggle that matches the dataframe toolbar. -- ⬆️ Frontend dependencies for Vega have been upgraded ([#9443](https://github.com/streamlit/streamlit/pull/9443), [#9438](https://github.com/streamlit/streamlit/issues/9438)). -- 🕵️ Streamlit is compatible with Watchdog version 5 ([#9354](https://github.com/streamlit/streamlit/pull/9354)). Thanks, [RubenVanEldik](https://github.com/RubenVanEldik)! -- 🔁 Streamlit is compatible with Tenacity version 9 ([#9348](https://github.com/streamlit/streamlit/pull/9348)). -- 🔢 Bug fix: Column configuration will override any text or number format from `pandas.Styler` ([#9538](https://github.com/streamlit/streamlit/pull/9538), [#7329](https://github.com/streamlit/streamlit/issues/7329), [#7977](https://github.com/streamlit/streamlit/issues/7977)). -- 🦋 Bug fix: Deck GL zoom button has the correct border radius ([#9536](https://github.com/streamlit/streamlit/pull/9536)). -- 🦐 Bug fix: Embedded apps have the correct padding to avoid hiding elements ([#9524](https://github.com/streamlit/streamlit/pull/9524), [#9341](https://github.com/streamlit/streamlit/issues/9341)). -- 🎨 Bug fix: The `st.multiselect` placeholder text has the correct color ([#9523](https://github.com/streamlit/streamlit/pull/9523), [#9514](https://github.com/streamlit/streamlit/issues/9514)). -- 🧹 Bug fix: `st.json` scrolls horizontally instead of overflowing its container ([#9521](https://github.com/streamlit/streamlit/pull/9521), [#9520](https://github.com/streamlit/streamlit/issues/9520)). -- 🌬️ Bug fix: Bokeh charts (temporarily) don't have a fullscreen button to prevent horizontal scrolling ([#9528](https://github.com/streamlit/streamlit/pull/9528), [#2358](https://github.com/streamlit/streamlit/issues/2358)). -- 🐡 Bug fix: Users are correctly redirected if they add a trailing slash to a page URL ([#9500](https://github.com/streamlit/streamlit/pull/9500), [#9127](https://github.com/streamlit/streamlit/issues/9127)). -- 📁 Bug fix: `st.Page` warns developers against using subdirectories in `url_path`, which is not supported ([#9499](https://github.com/streamlit/streamlit/pull/9499)). -- 💩 Bug fix: Streamlit correctly calculates dataframe widths to prevent Minified React error #185: Maximum update depth exceeded ([#9490](https://github.com/streamlit/streamlit/pull/9490), [#7949](https://github.com/streamlit/streamlit/issues/7949)). -- ☠️ Bug fix: ScriptRunContext handles the active script hash to avoid a race condition where widgets lose state in a multipage app ([#9441](https://github.com/streamlit/streamlit/pull/9441), [#9100](https://github.com/streamlit/streamlit/issues/9100)). -- 🪱 Bug fix: PDFs don't appear as plain text when hosted through static file serving in Streamlit ([#9439](https://github.com/streamlit/streamlit/pull/9439), [#9425](https://github.com/streamlit/streamlit/issues/9425)). -- 👻 Bug fix: Fragment elements don't disappear when used with custom components and callbacks ([#9381](https://github.com/streamlit/streamlit/pull/9381), [#9389](https://github.com/streamlit/streamlit/pull/9389), [#9372](https://github.com/streamlit/streamlit/issues/9372)). -- 👽 Bug fix: Streamlit watches the correct directory for file changes ([#9453](https://github.com/streamlit/streamlit/pull/9453), [#7467](https://github.com/streamlit/streamlit/issues/7467)). -- 🦀 Bug fix: The sidebar navigation uses page count to determine when to display a "show more" button for more consistent behavior ([#9394](https://github.com/streamlit/streamlit/pull/9394)). -- 🦎 Bug fix: The internal script hash is updated at the beginning of a script run instead of the end for correct page routing when a script run is interrupted ([#9408](https://github.com/streamlit/streamlit/pull/9408), [#8975](https://github.com/streamlit/streamlit/issues/8975)). -- 🐌 Bug fix: Bold formatting in headers is ignored ([#9395](https://github.com/streamlit/streamlit/pull/9395), [#4248](https://github.com/streamlit/streamlit/issues/4428)). -- 🕸️ Bug fix: Streamlit correctly identifies the MIME type of more files to prevent custom components from not rendering ([#9390](https://github.com/streamlit/streamlit/pull/9390), [#9365](https://github.com/streamlit/streamlit/issues/9365)). Thanks, [t0mdavid-m](https://github.com/t0mdavid-m)! -- 🦗 Bug fix: The `client.showSidebarNavigation` configuration option works correctly with `st.navigation` ([#9379](https://github.com/streamlit/streamlit/pull/9379)). -- 🦂 Bug fix: Streamlit uses `example.com` instead of `test.com` in a health check to avoid unnecessary warnings ([#9371](https://github.com/streamlit/streamlit/pull/9371)). Thanks, [wyattscarpenter](https://github.com/wyattscarpenter)! -- 🦟 Bug fix: `st.Page` will raise an error if it tries to initialize a page with an empty path ([#9374](https://github.com/streamlit/streamlit/pull/9374), [#8892](https://github.com/streamlit/streamlit/issues/8892)). -- 🦠 Bug fix: An unchanged `st.dialog` can be programmatically reopened after a user has dismissed it ([#9333](https://github.com/streamlit/streamlit/pull/9333), [#9323](https://github.com/streamlit/streamlit/issues/9323)). -- 🪰 Bug fix: Streamlit will not remove underscores from declared page titles in `st.Page` ([#9375](https://github.com/streamlit/streamlit/pull/9375), [#8890](https://github.com/streamlit/streamlit/issues/8890)). -- 🪳 Bug fix: `st.logo` does not flicker when switching pages ([#9361](https://github.com/streamlit/streamlit/pull/9361), [#8815](https://github.com/streamlit/streamlit/issues/8815)). -- 🕷️ Bug fix: `st.data_editor` allows users to re-add a row with the same index after deleting it ([#8864](https://github.com/streamlit/streamlit/pull/8864), [#8854](https://github.com/streamlit/streamlit/issues/8854)). -- 🐞 Bug fix: `st.logo` maintains its aspect ratio when resized to fit within the sidebar width ([#9368](https://github.com/streamlit/streamlit/pull/9368)). -- 🐝 Bug fix: Streamlit correctly removes `st.logo` if not called during a rerun ([#9337](https://github.com/streamlit/streamlit/pull/9337), [#9336](https://github.com/streamlit/streamlit/issues/9336)). -- 🐜 Bug fix: `st.logo` does not flicker when the sidebar changes its state ([#9338](https://github.com/streamlit/streamlit/pull/9338)). -- 🪲 Bug fix: Streamlit renders `st.balloons` and `st.snow` in a React Portal for improved rendering and compatibility with `st.dialog` ([#9335](https://github.com/streamlit/streamlit/pull/9335), [#9236](https://github.com/streamlit/streamlit/issues/9236)). -- 🐛 Bug fix: Option labels are cleanly truncated when `st.multiselect` is displayed in a narrow container ([#9334](https://github.com/streamlit/streamlit/pull/9334), [#8213](https://github.com/streamlit/streamlit/issues/8213)). - -## **Version 1.38.0** - -_Release date: August 27, 2024_ - -**Highlights** - -- 📈 Streamlit natively supports more dataframe formats! Use dataframe and series objects from popular libraries like Dask, Modin, Numpy, pandas, Polars, PyArrow, Snowpark, Xarray, and more. Use database cursors compliant with the Python Database API Specification 2.0. Use anything that supports the Python dataframe interchange protocol. See the [docs](/develop/api-reference/data/st.dataframe). - -**Notable Changes** - -- ↔️ You can control the initial expansion state of [`st.json`](/develop/api-reference/data/st.json) elements. -- 🧑‍💻 You can choose to wrap lines in [`st.code`](/develop/api-reference/text/st.code). -- 🕵️ Streamlit supports Kubernetes style secrets so you can use Snowflake Snowpark Container Services secret format ([#9078](https://github.com/streamlit/streamlit/pull/9078)). -- ⤴️ Breaking change: We removed a patch that allows custom validators in `pydantic - ---- - -# 2023 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2023 - - -This page contains release notes for Streamlit versions released in 2023. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## **Version 1.29.0** - -_Release date: November 30, 2023_ - -**Highlights** - -- 🔲 [`st.container`](/develop/api-reference/layout/st.container) and [`st.form`](/develop/api-reference/execution-flow/st.form) now have a `border` parameter to show or hide a border. -- 🐍 Streamlit supports Python 3.12! - -**Notable Changes** - -- ⌛ `st.dataframe`, `st.data_editor`, and `st.table` support `datetime.timedelta` values ([#7689](https://github.com/streamlit/streamlit/pull/7689), [#4489](https://github.com/streamlit/streamlit/issues/4489)). -- 💀 Streamlit apps preload skeleton elements for a smoother appearance when initializing ([#7598](https://github.com/streamlit/streamlit/pull/7598)). -- 🏃 Reduced the overhead of running `AppTest`-simulated apps, especially for fast-running apps ([#7691](https://github.com/streamlit/streamlit/pull/7691)). -- 🛁 String representations of `AppTest` data are improved for a better testing and debugging experience ([#7658](https://github.com/streamlit/streamlit/pull/7658)). -- 🔢 Apps can be configured to identify `Enum` classes as the same if they have matching member names ([#7408](https://github.com/streamlit/streamlit/pull/7408), [#4909](https://github.com/streamlit/streamlit/issues/4909)). Thanks, [Asaurus1](https://github.com/Asaurus1)! -- ❌ The "Made with Streamlit" footer no longer appears at the bottom of apps ([#7583](https://github.com/streamlit/streamlit/pull/7583)). -- 🧹 Unused config options have been deprecated ([#7584](https://github.com/streamlit/streamlit/pull/7584)). -- 🕳️ Query parameters can be empty ([#7601](https://github.com/streamlit/streamlit/pull/7601), [#7416](https://github.com/streamlit/streamlit/issues/7416)). -- 💅 Visual tweaks ([#7592](https://github.com/streamlit/streamlit/pull/7592), [#7630](https://github.com/streamlit/streamlit/pull/7630)). - -**Other Changes** - -- 🦗 Bug fix: Convert floats to bytes instead of hashing to avoid hashing instability ([#7754](https://github.com/streamlit/streamlit/pull/7754)). Thanks, [BlackHC](https://github.com/BlackHC)! -- 🦎 Bug fix: Corrected broken URLs and typos in error messages ([#7746](https://github.com/streamlit/streamlit/pull/7746), [#7764](https://github.com/streamlit/streamlit/pull/7764), [#7770](https://github.com/streamlit/streamlit/pull/7770)). Thanks, [ObservedObserver](https://github.com/ObservedObserver)! -- 🐌 Bug fix: `st.connection` correctly caches results when using two connections of the same type ([#7730](https://github.com/streamlit/streamlit/pull/7730), [#7709](https://github.com/streamlit/streamlit/issues/7709)). -- 🕸️ Bug fix: Using context managers with multithreading now displays content in the expected order ([#7715](https://github.com/streamlit/streamlit/pull/7715), [#7668](https://github.com/streamlit/streamlit/issues/7668)). Thanks, [eric-skydio](https://github.com/eric-skydio)! -- 🦂 Bug fix: Added https fallback when obtaining the host machine's address ([#7712](https://github.com/streamlit/streamlit/pull/7712), [#7703](https://github.com/streamlit/streamlit/issues/7703)). Thanks, [LarsHill](https://github.com/LarsHill)! -- 🛡️ Bug fix: Added security patch for `pyarrow` vulnerability. Custom components using `pyarrow` table deserialization should require `pyarrow>=14.0.1` ([#7695](https://github.com/streamlit/streamlit/pull/7695), [#7700](https://github.com/streamlit/streamlit/issues/7700)). -- 🦟 Bug fix: Improved typing for `st.connection` ([#7671](https://github.com/streamlit/streamlit/pull/7671)). Thanks, [thezanke](https://github.com/thezanke)! -- 🪰 Bug fix: Retries of `SnowflakeConnection` methods are narrowed to only occur with transient errors to avoid unnecessary repeated errors ([#7645](https://github.com/streamlit/streamlit/pull/7645), [#7637](https://github.com/streamlit/streamlit/issues/7637)). -- 🏗️ Removed the v0 testing framework which was undocumented ([#7657](https://github.com/streamlit/streamlit/pull/7657)). -- 🪳 Bug fix: The navigation expander arrow no longer disappears ([#7634](https://github.com/streamlit/streamlit/pull/7634), [#7547](https://github.com/streamlit/streamlit/issues/7547)). -- ❄️ Improved the error message for `SnowflakeConnection` when a configuration is not found ([#7652](https://github.com/streamlit/streamlit/pull/7652)). -- 🕷️ Bug fix: `st.rerun` no longer causes a `RecursionError` when used with `st.chat_input` ([#7643](https://github.com/streamlit/streamlit/pull/7643), [#7629](https://github.com/streamlit/streamlit/issues/7629)). -- 🐞 Bug fix: `st.file_uploader` no longer causes an extra rerun and therefore doesn't conflict with `st.chat_input` ([#7641](https://github.com/streamlit/streamlit/pull/7641), [#7556](https://github.com/streamlit/streamlit/issues/7556)). -- 🐝 Bug fix: `AppTest` no longer raises an error when encountering `st.container` ([#7644](https://github.com/streamlit/streamlit/pull/7644), [#7636](https://github.com/streamlit/streamlit/issues/7636)). -- 🪲 Bug fix: Graphviz charts scale correctly when exiting fullscreen view ([#7398](https://github.com/streamlit/streamlit/pull/7398), [#7527](https://github.com/streamlit/streamlit/issues/6527)). -- 🎥 Bug fix: "Record a screencast" is hidden when known to be unsupported in a browser ([#7604](https://github.com/streamlit/streamlit/pull/7604)). -- 🐛 Bug fix: Increased the top padding of embedded apps to better display the dataframe toolbar ([#7681](https://github.com/streamlit/streamlit/pull/7681), [#7609](https://github.com/streamlit/streamlit/pull/7609), [#7607](https://github.com/streamlit/streamlit/issues/7607)). -- 🐜 Bug fix: `st.rerun` uses `NoReturn` for improved type checking ([#7422](https://github.com/streamlit/streamlit/pull/7422)) Thanks, [kongzii](https://github.com/kongzii). - -## **Version 1.28.0** - -_Release date: October 26, 2023_ - -**Release videos** - -- [Introducing `AppTest`](https://www.youtube.com/watch?v=99OEoP5sy0U) - -**Highlights** - -- 🧪 Introducing a new testing framework for Streamlit apps! Check out our [documentation](/develop/api-reference/app-testing) to learn how to build automated tests for your apps. -- 💻 Announcing the general availability of `st.connection`, a command to conveniently manage connections in Streamlit apps. Check out the [docs](/develop/api-reference/connections/st.connection) to learn more. -- ❄️ `SnowparkConnection` has been upgraded to the new and improved `SnowflakeConnection` — the same, great functionality _plus more_! Check out our [built-in connections](/develop/api-reference/connections#built-in-connections). -- 🛠️ `st.dataframe` and `st.data_editor` have a new toolbar! Users can search and download data in addition to enjoying improved UI for row additions and deletions. See our updated guide on [Dataframes](/develop/concepts/design/dataframes). - -**Notable Changes** - -- 🌀 When using a spinner with cached functions, the spinner will be overlaid instead of pushing content down ([#7488](https://github.com/streamlit/streamlit/pull/7488)). -- 📅 `st.data_editor` now supports datetime index editing ([#7483](https://github.com/streamlit/streamlit/pull/7483)). -- 🔢 Improved support for `decimal.Decimal` in `st.dataframe` and `st.data_editor` ([#7475](https://github.com/streamlit/streamlit/pull/7475)). -- 🥸 Global kwargs were added for `hashlib` ([#7527](https://github.com/streamlit/streamlit/pull/7527), [#7526](https://github.com/streamlit/streamlit/issues/7526)). Thanks, [DueViktor](https://github.com/DueViktor)! -- 📋 `st.components.v1.iframe` now permits writing to clipboard ([#7487](https://github.com/streamlit/streamlit/pull/7487)). Thanks, [dilipthakkar](https://github.com/dilipthakkar)! -- 📝 `SafeSessionState` disconnect was replaced with script runner yield points for improved efficiency and clarity ([#7373](https://github.com/streamlit/streamlit/pull/7373)). -- 🤖 The Langchain callback handler will show the full input string inside the body of a `st.status` when the input string is too long to show as a label ([#7478](https://github.com/streamlit/streamlit/pull/7478)). Thanks, [pokidyshev](https://github.com/pokidyshev)! -- 📈 `st.graphviz_chart` now supports using different Graphviz layout engines ([#7505](https://github.com/streamlit/streamlit/pull/7505), [#4089](https://github.com/streamlit/streamlit/issues/4089)). -- 🦋 Assorted visual tweaks ([#7486](https://github.com/streamlit/streamlit/pull/7486), [#7592](https://github.com/streamlit/streamlit/pull/7592)). -- 📊 `plotly.js` was upgraded to version 2.26.1 ([#7449](https://github.com/streamlit/streamlit/pull/7449), [#7476](https://github.com/streamlit/streamlit/issues/7476), [#7045](https://github.com/streamlit/streamlit/issues/7045)). -- 💽 Legacy serialization for DataFrames was removed. All DataFrames will be serialized by Apache Arrow ([#7429](https://github.com/streamlit/streamlit/pull/7429)). -- 🖼️ Compatibility for Pillow 10.x was added ([#7442](https://github.com/streamlit/streamlit/pull/7442)). -- 📬 Migrated `_stcore/allowed-message-origins` endpoint to `_stcore/host-config` ([#7342](https://github.com/streamlit/streamlit/pull/7342)). -- 💬 Added `post_parent_message` platform command to send custom messages from a Streamlit app to its parent window ([#7522](https://github.com/streamlit/streamlit/pull/7522)). - -**Other Changes** - -- ⌨️ Improved string dtype handling for DataFrames ([#7479](https://github.com/streamlit/streamlit/pull/7479)). -- ✒️ `st.write` will avoid using `unsafe_allow_html=True` if possible ([#7432](https://github.com/streamlit/streamlit/pull/7432)). -- 🐛 Bug fix: Implementation of `st.expander` was simplified for improved behavior and consistency ([#7247](https://github.com/streamlit/streamlit/pull/7247), [#2839](https://github.com/streamlit/streamlit/issues/2839), [#4111](https://github.com/streamlit/streamlit/issues/4111), [#4651](https://github.com/streamlit/streamlit/issues/4651), [#5604](https://github.com/streamlit/streamlit/issues/5604)). -- 🪲 Bug fix: Multipage links in the sidebar are now aligned with other sidebar elements ([#7531](https://github.com/streamlit/streamlit/pull/7531)). -- 🐜 Bug fix: `st.chat_input` won't incorrectly prompt for `label` parameter in IDEs ([#7560](https://github.com/streamlit/streamlit/pull/7560)). -- 🐝 Bug fix: Scroll bars correctly overlay `st.dataframe` and `st.data_editor` without adding empty space ([#7090](https://github.com/streamlit/streamlit/pull/7090), [#6888](https://github.com/streamlit/streamlit/issues/6888)). -- 🐞 Bug fix: `st.chat_message` behaves correctly with the removal of AutoSizer ([#7504](https://github.com/streamlit/streamlit/pull/7504), [#7473](https://github.com/streamlit/streamlit/issues/7473)). -- 🕷️ Bug fix: Anchor links are reliably produced for non-English headers ([#7454](https://github.com/streamlit/streamlit/pull/7454), [#5291](https://github.com/streamlit/streamlit/issues/5291)). -- ☃️ Bug fix: `st.connections.SnowparkConnection` more accurately detects when it's running within Streamlit in Snowflake ([#7502](https://github.com/streamlit/streamlit/pull/7502)). -- 🪳 Bug fix: A user-friendly warning is shown when exceeding the size limitations of a pandas `Styler` object ([#7497](https://github.com/streamlit/streamlit/pull/7497), [#5953](https://github.com/streamlit/streamlit/issues/5953)). -- 🪰 Bug fix: `st.data_editor` automatically converts non-string column names to strings ([#7485](https://github.com/streamlit/streamlit/pull/7485), [#6950](https://github.com/streamlit/streamlit/issues/6950)). -- 🦠 Bug fix: `st.data_editor` correctly identifies non-range indices as a required column ([#7481](https://github.com/streamlit/streamlit/pull/7481), [#6995](https://github.com/streamlit/streamlit/issues/6995)). -- 🦟 Bug fix: `st.file_uploader` displays compound file extensions like `csv.gz` correctly ([#7362](https://github.com/streamlit/streamlit/pull/7362)). Thanks, [mo42](https://github.com/mo42)! -- 🦂 Bug fix: Column Configuration no longer uses deprecated type checks ([#7496](https://github.com/streamlit/streamlit/pull/7496), [#7477](https://github.com/streamlit/streamlit/pull/7477), [#7550](https://github.com/streamlit/streamlit/issues/7550)). Thanks, [c-bik](https://github.com/c-bik)! -- 🦗 Bug fix: Additional toolbar items no longer stack vertically ([#7470](https://github.com/streamlit/streamlit/pull/7470), [#7471](https://github.com/streamlit/streamlit/issues/7471)). -- 🕸️ Bug fix: Column Configuration no longer causes a type warning in Mypy ([#7457](https://github.com/streamlit/streamlit/pull/7457)). Thanks, [kopp](https://github.com/kopp)! -- 🐌 Bug fix: Bokeh Sliders no longer cause JavaScript errors ([#7441](https://github.com/streamlit/streamlit/pull/7441), [#7171](https://github.com/streamlit/streamlit/issues/7171)). -- 🦎 Bug fix: Caching now recognizes DataFrames with the same values but different column names as different ([#7331](https://github.com/streamlit/streamlit/pull/7331), [#7086](https://github.com/streamlit/streamlit/issues/7086)). - -## **Version 1.27.0** - -_Release date: September 21, 2023_ - -**Highlights** - -- ✨ Introducing `st.scatter_chart` — a new, simple chart element to build scatter charts Streamlit-y fast and easy! See our [documentation](/develop/api-reference/charts/st.scatter_chart). -- 🔗 Introducing `st.link_button`! Want to open an external link in a new tab with a bit more pizazz than a plain-text link? Check out our [documentation](/develop/api-reference/widgets/st.link_button) to see how. -- 🏃 Announcing the general availability of [`st.rerun`](/develop/api-reference/execution-flow/st.rerun), a command to interrupt your script and trigger an immediate rerun. - -**Notable Changes** - -- 👻 You can initialize widgets with an empty state by setting `None` as an initial value for [`st.number_input`](/develop/api-reference/widgets/st.number_input), [`st.selectbox`](/develop/api-reference/widgets/st.selectbox), [`st.date_input`](/develop/api-reference/widgets/st.date_input), [`st.time_input`](/develop/api-reference/widgets/st.time_input), [`st.radio`](/develop/api-reference/widgets/st.radio), [`st.text_input`](/develop/api-reference/widgets/st.text_input), and [`st.text_area`](/develop/api-reference/widgets/st.text_area)! -- 📤 [`st.download_button`](/develop/api-reference/widgets/st.download_button) now uses `target="_self"` instead of opening a new tab ([#7151](https://github.com/streamlit/streamlit/pull/7151), [#7132](https://github.com/streamlit/streamlit/issues/7132)). -- 🧟 Removed unmaintained `pympler` dependency ([#7193](https://github.com/streamlit/streamlit/pull/7193), [#7131](https://github.com/streamlit/streamlit/issues/7131)). Thanks, [rudyardrichter](https://github.com/rudyardrichter)! - -**Other Changes** - -- 🐛 Bug fix: `st.multiselect` now shows a correct message when no result matches a user's search ([#7205](https://github.com/streamlit/streamlit/pull/7205), [#7116](https://github.com/streamlit/streamlit/issues/7116)). -- 🪲 Bug fix: `st.experimental_user` now defaults to `test@example.com` ([#7219](https://github.com/streamlit/streamlit/pull/7219), [#7215](https://github.com/streamlit/streamlit/issues/7215)). -- 🐜 Bug fix: `st.slider` labels don't overlap when small ranges are selected ([#7221](https://github.com/streamlit/streamlit/pull/7221), [#3385](https://github.com/streamlit/streamlit/issues/3385)). -- 🐝 Bug fix: Type-checking correctly identifies all string types to avoid hashing errors ([#7255](https://github.com/streamlit/streamlit/pull/7255), [#6455](https://github.com/streamlit/streamlit/issues/6455)). -- 🐞 Bug fix: JSON is parsed with JSON5 to avoid errors from null values when using `st.pydeck_chart` ([#7256](https://github.com/streamlit/streamlit/pull/7256), [#5799](https://github.com/streamlit/streamlit/issues/5799)). -- 🕷️ Bug fix: Identical widgets on different pages are correctly interpreted by Streamlit as distinct ([#7264](https://github.com/streamlit/streamlit/pull/7264), [#6146](https://github.com/streamlit/streamlit/issues/6146)). -- 🦋 Bug fix: Visual tweaks to widgets for responsive behavior ([#7145](https://github.com/streamlit/streamlit/pull/7145)). -- 🪳 Bug fix: SVGs are accurately displayed ([#7183](https://github.com/streamlit/streamlit/pull/7183), [#3882](https://github.com/streamlit/streamlit/issues/3882)). -- 🪰 Bug fix: `st.video` correctly updates with changes to `start_time` ([#7257](https://github.com/streamlit/streamlit/pull/7257), [#7126](https://github.com/streamlit/streamlit/issues/7126)). -- 🦠 Bug fix: Additional error handling was added to `st.session_state` ([#7280](https://github.com/streamlit/streamlit/pull/7280), [#7206](https://github.com/streamlit/streamlit/issues/7206)). -- 🦟 Bug fix: `st.map` correctly refreshes with new data ([#7307](https://github.com/streamlit/streamlit/pull/7307), [#7294](https://github.com/streamlit/streamlit/issues/7294)). -- 🦂 Bug fix: The decorative app header line is no longer covered by the sidebar ([#7297](https://github.com/streamlit/streamlit/pull/7297), [#6264](https://github.com/streamlit/streamlit/issues/6264)). -- 🦗 Bug fix: `st.code` no longer triggers a `CachedStFunctionWarning` ([#7306](https://github.com/streamlit/streamlit/pull/7306), [#7055](https://github.com/streamlit/streamlit/issues/7055)). -- 🕸️ Bug fix: `st.download_button` no longer resets with different `data` ([#7316](https://github.com/streamlit/streamlit/pull/7316), [#7308](https://github.com/streamlit/streamlit/issues/7308)). -- 🐌 Bug fix: Widgets consistently recognize user interaction while a page is still running, with or without `fastRerun` enabled ([#7283](https://github.com/streamlit/streamlit/pull/7283), [#6643](https://github.com/streamlit/streamlit/issues/6643)). -- 🦎 Bug fix: `st.tabs` was improved to better handle and render conditionally appearing tabs ([#7287](https://github.com/streamlit/streamlit/pull/7287), [#7310](https://github.com/streamlit/streamlit/pull/7310), [#5454](https://github.com/streamlit/streamlit/issues/5454), [#7040](https://github.com/streamlit/streamlit/issues/7040)). - -## **Version 1.26.0** - -_Release date: August 24, 2023_ - -**Highlights** - -- 🤖 Introducing `st.status` to display output from long-running processes and external API calls ([#7140](https://github.com/streamlit/streamlit/pull/7140)). Works great with `st.chat_message`! See our [documentation](/develop/api-reference/status/st.status) for how to use this feature. -- 🚥 Introducing [`st.toggle`](/develop/api-reference/widgets/st.toggle) — an alternative to `st.checkbox` when you need an on/off switch. - -**Notable Changes** - -- 🎨 Simple [chart elements](/develop/api-reference/charts) have a `color` parameter to set the color of your data points or series ([#7022](https://github.com/streamlit/streamlit/pull/7022)). -- 🌈 [Markdown](/develop/api-reference/text/st.markdown) supports rainbow and gray colors ([#7106](https://github.com/streamlit/streamlit/pull/7106), [#7179](https://github.com/streamlit/streamlit/pull/7179)). -- 📏 [`st.header`](/develop/api-reference/text/st.header) and [`st.subheader`](/develop/api-reference/text/st.subheader) have optional, colored dividers ([#7133](https://github.com/streamlit/streamlit/pull/7133)). -- 🚀 Deploying to Community Cloud is even easier—locally running apps have a [deploy button](/develop/concepts/architecture/app-chrome#deploy-this-app) in their toolbars ([#7085](https://github.com/streamlit/streamlit/pull/7085), [#6935](https://github.com/streamlit/streamlit/issues/6935)). -- 🖌️ [`st.download_button`](/develop/api-reference/widgets/st.download_button) has a new parameter `type` for theming ([#7056](https://github.com/streamlit/streamlit/pull/7056), [#7038](https://github.com/streamlit/streamlit/issues/7038)). -- 🤖 [`st.chat_message`](/develop/api-reference/chat/st.chat_message) has ai and human presets for messages ([#7094](https://github.com/streamlit/streamlit/pull/7094)). -- 💅 [`st.radio`](/develop/api-reference/widgets/st.radio) options support markdown and have captions ([#7018](https://github.com/streamlit/streamlit/pull/7018), [#7105](https://github.com/streamlit/streamlit/pull/7105), [#6085](https://github.com/streamlit/streamlit/issues/6085)). -- 🧼 Assorted visual tweaks ([#7050](https://github.com/streamlit/streamlit/pull/7050), [#894](https://github.com/streamlit/streamlit/issues/894)). -- 🛏️ Replaced deprecated `imghdr` dependency with `pillow` ([#7081](https://github.com/streamlit/streamlit/pull/7081), [#7027](https://github.com/streamlit/streamlit/issues/7027)). -- 🔢 [`st.number_input`](/develop/api-reference/widgets/st.number_input)'s step buttons (+/-) are ignored during tabbing navigation ([#7154](https://github.com/streamlit/streamlit/pull/7154)). Thanks [@denck007](https://github.com/denck007)! - -**Other Changes** - -- 🍞 Bug fix: Toast messages are no longer blocked by `st.chat_input` ([#7204](https://github.com/streamlit/streamlit/pull/7204), [#7115](https://github.com/streamlit/streamlit/issues/7115)). -- 🕸️ Bug fix: Widget IDs are now stable to prevent inconsistent statefulness ([#7003](https://github.com/streamlit/streamlit/pull/7003)). -- 🦟 Bug fix: Browser autofill is correctly recognized within forms now ([#7150](https://github.com/streamlit/streamlit/pull/7150), [#7101](https://github.com/streamlit/streamlit/issues/7101), [#7084](https://github.com/streamlit/streamlit/issues/7084)). -- 🪱 Bug fix: `st.file_uploader` no longer causes session state to reset when a websocket connection is dropped and reconnected ([#7149](https://github.com/streamlit/streamlit/pull/7149), [#7025](https://github.com/streamlit/streamlit/pull/7025)). -- 🏎️ Bug fix: Pydeck JSON data is cached for improved performance ([#7113](https://github.com/streamlit/streamlit/pull/7113), [#5532](https://github.com/streamlit/streamlit/issues/5532)). -- 🦋 Bug fix: `st.chat_input` no longer submits prematurely while typing with an input method editor ([#6993](https://github.com/streamlit/streamlit/pull/6993)). -- 🐞 Bug fix: Label backgrounds for `st.tabs` are now transparent ([#7070](https://github.com/streamlit/streamlit/pull/7070), [#5707](https://github.com/streamlit/streamlit/issues/5707)). -- 🐝 Bug fix: Page width is no longer ignored when using the `help` parameter in `st.button` ([#7033](https://github.com/streamlit/streamlit/pull/7033), [#6161](https://github.com/streamlit/streamlit/issues/6161)). -- 🐜 Bug fix: Tweaked Altair color specification for improved visibility in dark mode ([#7061](https://github.com/streamlit/streamlit/pull/7061), [#3343](https://github.com/streamlit/streamlit/issues/3343)). -- 🪲 Bug fix: `st.chat_message` can correctly use local images as avatars ([#7130](https://github.com/streamlit/streamlit/pull/7130)). -- 🐛 Bug fix: Specified that MD5 is not used for security ([#7122](https://github.com/streamlit/streamlit/pull/7122), [#7120](https://github.com/streamlit/streamlit/issues/7120)). -- 🪄 Bug fix: Async function docstrings are ignored by [Streamlit magic](/develop/api-reference/write-magic/magic) ([#7143](https://github.com/streamlit/streamlit/pull/7143), [#7137](https://github.com/streamlit/streamlit/issues/7137)). - -## **Version 1.25.0** - -_Release date: July 20, 2023_ - -**Highlights** - -- 🍞 Introducing `st.toast` — a command to briefly show toast messages to users in the bottom-right corner of apps. See [our documentation](/develop/api-reference/status/st.toast) on how to use this feature. - -**Notable Changes** - -- 🗺️ [`st.map`](/develop/api-reference/charts/st.map) now has parameters for `latitude`, `longitude`, `color`, and `size` to customize data points ([#6896](https://github.com/streamlit/streamlit/pull/6896)). -- 🚩 [`st.multiselect`](/develop/api-reference/widgets/st.multiselect) supports setting placeholders and specifying the maximum number of selections via the `placeholder` and `max_selections` keyword-only arguments, respectively ([#6901](https://github.com/streamlit/streamlit/pull/6901), [#4750](https://github.com/streamlit/streamlit/issues/4750)). Thanks, [@fhiroki](https://github.com/fhiroki)! -- 📅 Customize the date format for `st.date_input` with the `format` parameter ([#6974](https://github.com/streamlit/streamlit/pull/6974), [#5234](https://github.com/streamlit/streamlit/issues/5234)). -- ↩️ [Forms](/develop/api-reference/execution-flow/st.form) can now be submitted with Enter/Return while inside [`st.text_input`](/develop/api-reference/widgets/st.text_input), [`st.number_input`](/develop/api-reference/widgets/st.number_input), or [`st.text_area`](/develop/api-reference/widgets/st.text_area) ([#6911](https://github.com/streamlit/streamlit/pull/6911), [#3790](https://github.com/streamlit/streamlit/issues/3790)). -- 🍢 The app menu icon in the upper-right corner of apps has been changed from "**☰**" to "**⋮**" ([#6947](https://github.com/streamlit/streamlit/pull/6947)). - -**Other Changes** - -- ⛓️ Minimum required versions increased for multiple Python dependencies, including `numpy>=1.19.3` and `pandas>=1.3.0` ([#6802](https://github.com/streamlit/streamlit/pull/6802)). -- 🛡️ `protobufjs` was bumped from 7.2.1 to 7.2.4 ([#6959](https://github.com/streamlit/streamlit/pull/6959)). -- ✨ Visual design tweaks to Streamlit's input widgets ([#6944](https://github.com/streamlit/streamlit/pull/6944)). -- 🦋 Bug Fix: `st.slider` now accepts general number types like `numpy.int64` instead of just `int` and `float` ([#6816](https://github.com/streamlit/streamlit/pull/6816), [#6815](https://github.com/streamlit/streamlit/issues/6815)). Thanks, [@milliams](https://github.com/milliams)! -- 🐜 Bug Fix: Data labels for `st.slider` and `st.select_slider` no longer overflow when inside `st.expander` ([#6828](https://github.com/streamlit/streamlit/pull/6828), [#6297](https://github.com/streamlit/streamlit/issues/6297)). -- 🐛 Bug Fix: Elements no longer re-render from scratch with each rerun ([#6923](https://github.com/streamlit/streamlit/pull/6923), [#6920](https://github.com/streamlit/streamlit/issues/6920)). -- 🐞 Bug Fix: `st.data_editor` hashes styler objects correctly for stability across reruns ([#6815](https://github.com/streamlit/streamlit/pull/6915), [#6898](https://github.com/streamlit/streamlit/issues/6898)). -- 🐝 Bug Fix: Fixed the padding for embedded apps using `st.chat_input` to prevent messages being cutoff ([#6979](https://github.com/streamlit/streamlit/pull/6979)). - -## **Version 1.24.0** - -_Release date: June 27, 2023_ - -**Highlights** - -- 💬 Introducing `st.chat_message` and `st.chat_input` — two new [chat elements](/develop/api-reference/chat) that let you build conversational apps. Learn how to use these features in your LLM-powered chat apps in our [tutorial](/develop/tutorials/llms/build-conversational-apps). -- 💾 Streamlit's caching decorators now allow you to customize Streamlit's hashing of input parameters with the keyword-only argument [`hash_funcs`](/develop/concepts/architecture/caching#the-hash_funcs-parameter). - -**Notable Changes** - -- 🐍 We've deprecated support for Python 3.7 in the core library and Streamlit Community Cloud ([#6868](https://github.com/streamlit/streamlit/pull/6868)). -- 📅 `st.cache_data` and `st.cache_resource` can hash timezone-aware `datetime` objects ([#6812](https://github.com/streamlit/streamlit/pull/6812), [#6690](https://github.com/streamlit/streamlit/issues/6690), [#5110](https://github.com/streamlit/streamlit/issues/5110)). - -**Other Changes** - -- ✨ Visual design tweaks to Streamlit's input widgets ([#6817](https://github.com/streamlit/streamlit/pull/6817)). -- 🐛 Bug fix: `st.write` pretty-prints dataclasses using `st.help` ([#6750](https://github.com/streamlit/streamlit/pull/6750)). -- 🪲 Bug fix: `st.button`'s height is consistent with that of other widgets ([#6738](https://github.com/streamlit/streamlit/pull/6738)). -- 🐜 Bug fix: Upgraded the `react-range` frontend dependency to fix the memory usage of sliders ([#6764](https://github.com/streamlit/streamlit/pull/6764), [#5436](https://github.com/streamlit/streamlit/issues/5436)). Thanks [@wolfd](https://github.com/wolfd)! -- 🐝 Bug fix: Pydantic validators no longer result in exceptions on app reruns ([#6664](https://github.com/streamlit/streamlit/pull/6664), [#3218](https://github.com/streamlit/streamlit/issues/3218)). -- 🐞 Bug fix: `streamlit config show` honors newlines ([#6758](https://github.com/streamlit/streamlit/pull/6758), [#2868](https://github.com/streamlit/streamlit/issues/2868)). -- 🪰 Bug fix: Fixed a race condition to ensure Streamlit reruns the latest code when the file changes ([#6884](https://github.com/streamlit/streamlit/pull/6884)). -- 🦋 Bug fix: Apps no longer rerun when users click anchor links ([#6834](https://github.com/streamlit/streamlit/pull/6834), [#6500](https://github.com/streamlit/streamlit/issues/6500)). -- 🕸️ Bug fix: Added robust out-of-bounds checks for `min_value` and `max_value` in `st.number_input` ([#6847](https://github.com/streamlit/streamlit/pull/6847), [#6797](https://github.com/streamlit/streamlit/issues/6797)). - -## **Version 1.23.0** - -_Release date: June 1, 2023_ - -**Highlights** - -- ✂️ Announcing the general availability of [st.data_editor](/develop/api-reference/data/st.data_editor), a widget that allows you to edit DataFrames and many other data structures in a table-like UI. **Breaking change:** the data editor's representation used in `st.session_state` was altered. Find out more about the new format in [Access edited data](/develop/concepts/design/dataframes#access-edited-data). -- ⚙️ Introducing the [Column configuration API](/develop/api-reference/data/st.column_config) with a suite of methods to configure the display and editing behavior of `st.dataframe` and `st.data_editor` columns (e.g. their title, visibility, type, or format). Keep an eye out for a detailed [blog post](https://blog.streamlit.io/) and in-depth [documentation](/develop/concepts/design/dataframes#configuring-columns) upcoming in the next two weeks. -- 🔌 Learn to use `st.experimental_connection` to create and manage data connections in your apps with the new [Connecting to data](/develop/concepts/connections/connecting-to-data) docs and [video tutorial](https://www.youtube.com/watch?v=xQwDfW7UHMo). - -**Notable Changes** - -- 📊 Streamlit now supports Protobuf 4 and Altair 5 ([#6215](https://github.com/streamlit/streamlit/issues/6215), [#6618](https://github.com/streamlit/streamlit/pull/6618), [#5626](https://github.com/streamlit/streamlit/issues/5626), [#6622](https://github.com/streamlit/streamlit/pull/6622)). -- ☎️ st.dataframe and st.data_editor can hide index columns with `hide_index`, specify the display order of columns with `column_order`, and disable editing for individual columns with the `disabled` parameter. -- ⏱️ The `ttl` parameter in [st.cache_data](/develop/api-reference/caching-and-state/st.cache_data) and [st.cache_resource](/develop/api-reference/caching-and-state/st.cache_resource) accepts formatted strings, so you can simply say `ttl="30d"`, `ttl="1h30m"` and any other combination of `w`, `d`, `h`, `m`, `s` supported by [Pandas's Timedelta constructor](https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html) ([#6560](https://github.com/streamlit/streamlit/pull/6560)). -- 📂 `st.file_uploader` now interprets the `type` parameter more accurately. For example, "jpg" or ".jpg" now accept both "jpg" and "jpeg" extensions. This functionality has also been extended to "mpeg/mpg", "tiff/tif", "html/htm", and "mpeg4/mp4". -- 🤫 The new `global.disableWidgetStateDuplicationWarning` configuration option allows the silencing of warnings triggered by setting widget default values and keyed session state values concurrently ([#3605](https://github.com/streamlit/streamlit/issues/3605), [#6640](https://github.com/streamlit/streamlit/pull/6640)). Thanks, [@antonAce](https://github.com/antonAce)! - -**Other Changes** - -- 🏃‍♀️Improved startup time by lazy loading some dependencies ([#6531](https://github.com/streamlit/streamlit/pull/6531)). -- 👋 Removed `st.beta_*` and `st.experimental_show` due to deprecation and low-use ([#6558](https://github.com/streamlit/streamlit/pull/6558)) -- 🚀 Further improvements to st.dataframe and st.data_editor: - - Improved editing on mobile devices for the data editor ([#6548](https://github.com/streamlit/streamlit/pull/6548)). - - All editable columns have an icon in their column header and support tooltips ([#6550](https://github.com/streamlit/streamlit/pull/6550), [#6561](https://github.com/streamlit/streamlit/pull/6561)). - - Enable editing for columns containing datetime, date, or time values ([#6025](https://github.com/streamlit/streamlit/pull/6025)). - - New input validation options for columns in the data editor, such as `max_chars` and `validate` for text columns, and `min_value`, `max_value` and `step` for number columns ([#6563](https://github.com/streamlit/streamlit/pull/6563)). - - Improved type parsing capabilities in the data editor ([#6551](https://github.com/streamlit/streamlit/pull/6551)). - - Unified missing values to `None` in returned data structures ([#6544](https://github.com/streamlit/streamlit/pull/6544)). - - A warning is shown in cells when integers exceed the maximum safe value of `(2^53) -1` ([#6311](https://github.com/streamlit/streamlit/issues/6311), [#6549](https://github.com/streamlit/streamlit/pull/6549)). - - Prevented editing the sessions state by showing a warning ([#6634](https://github.com/streamlit/streamlit/pull/6634)). - - Fixed issues with list columns sometimes breaking the frontend ([#6644](https://github.com/streamlit/streamlit/pull/6644)). - - Fixed a display issue with index columns using category dtype ([#6680](https://github.com/streamlit/streamlit/issues/6680), [#6598](https://github.com/streamlit/streamlit/pull/6598)). - - Fixed an issue that prevented a rerun when adding empty rows ([#6598](https://github.com/streamlit/streamlit/pull/6598)). - - Unified the behavior between `st.data_editor` and `st.dataframe` related to auto-hiding the index column(s) based on the input data ([#6659](https://github.com/streamlit/streamlit/issues/6659), [#6598](https://github.com/streamlit/streamlit/pull/6598)) -- 🛡️ Streamlit's [Security Policy](https://github.com/streamlit/streamlit/blob/develop/SECURITY.md) can be found in its GitHub repository ([#6666](https://github.com/streamlit/streamlit/pull/6666)). -- 🤏 Documented the integer size limit for `st.number_input` and `st.slider` ([#6724](https://github.com/streamlit/streamlit/pull/6724)). -- 🐍 The majority of Streamlit's Python dependencies have set a maximum allowable version, with the standard upper limit set to the next major version, but not inclusive of it ([#6691](https://github.com/streamlit/streamlit/pull/6691)). -- 💅 UI design improvements to in-app modals ([#6688](https://github.com/streamlit/streamlit/pull/6688)). -- 🐞 Bug fix: `st.date_input`'s date selector is equally visible in dark mode ([#6072](https://github.com/streamlit/streamlit/issues/6072), [#6630](https://github.com/streamlit/streamlit/pull/6630)). -- 🐜 Bug fix: the sidebar navigation expansion indicator in multipage apps is restored ([#6731](https://github.com/streamlit/streamlit/pull/6731)). -- 🐛 Bug fix: The docstring and exception message for `st.set_page_config` have been updated to clarify that this command can be invoked once for each page within a multipage app, rather than once per entire app ([#6594](https://github.com/streamlit/streamlit/pull/6594)). -- 🐝 Bug fix: `st.json` no longer collapses multiple spaces in both keys and values with single space when rendered ([#6657](https://github.com/streamlit/streamlit/issues/6657), [#6663](https://github.com/streamlit/streamlit/pull/6663)). - -## **Version 1.22.0** - -_Release date: April 27, 2023_ - -**Highlights** - -- 🔌 Introducing `st.experimental_connection`: Easily connect your app to data sources and APIs using our new connection feature. Find more details in the [API reference](/develop/api-reference/connections), and stay tuned for an upcoming blog post and in-depth documentation! In the meantime, explore our updated [MySQL](/develop/tutorials/databases/mysql) and [Snowflake](/develop/tutorials/databases/snowflake) connection tutorials for examples of this feature. - -**Notable Changes** - -- 🐼 Streamlit now supports Pandas 2.0 ([#6413](https://github.com/streamlit/streamlit/issues/6413), [#6378](https://github.com/streamlit/streamlit/pull/6378), [#6507](https://github.com/streamlit/streamlit/pull/6507)). Thanks, [connortann](https://github.com/connortann)! -- 🍔 Customize the visibility of items in the toolbar, options menu, and the settings dialog using the `client.toolbarMode` [config option](https://docs.streamlit.io/develop/concepts/configuration#view-all-configuration-options) ([#6174](https://github.com/streamlit/streamlit/pull/6174)). -- 🪵 Streamlit logs now reside in the "streamlit" namespace instead of the root logger, enabling app developers to better manage log handling ([#3978](https://github.com/streamlit/streamlit/issues/3978), [#6377](https://github.com/streamlit/streamlit/pull/6377)). - -**Other Changes** - -- 🔏 CLI parameters can no longer be used to set sensitive configuration values ([#6376](https://github.com/streamlit/streamlit/pull/6376)). -- 🤖 Improved the debugging experience by reducing log noise ([#6391](https://github.com/streamlit/streamlit/pull/6391)). -- 🐞 Bug fix: `@st.cache_data` decorated functions support UUID objects as parameters ([#6440](https://github.com/streamlit/streamlit/issues/6440), [#6459](https://github.com/streamlit/streamlit/pull/6459)). -- 🐛 Bug fix: Tabbing through buttons and other elements now displays a red border only when focused, not when clicked ([#6373](https://github.com/streamlit/streamlit/pull/6373)). -- 🪲 Bug fix: `st.multiselect`'s clear icon is larger and includes a hover effect ([#6471](https://github.com/streamlit/streamlit/pull/6471)). -- 🐜 Bug fix: Custom theme font settings no longer apply to code blocks ([#6484](https://github.com/streamlit/streamlit/issues/6484), [#6535](https://github.com/streamlit/streamlit/pull/6535)). -- ©️ Bug fix: `st.code`'s copy-to-clipboard button appears when you hover on code blocks ([#6490](https://github.com/streamlit/streamlit/issues/6490), [#6498](https://github.com/streamlit/streamlit/pull/6498)). - -## **Version 1.21.0** - -_Release date: April 6, 2023_ - -**Highlights** - -- 📏 Introducing `st.divider` — a command that displays a horizontal line in your app. Learn how to use this command in its [API reference](/develop/api-reference/text/st.divider). -- 🔏 Streamlit now supports the use of a global `secrets.toml` file, in addition to a project-level file, to easily store and securely access your secrets. Learn more in [Secrets management](/develop/concepts/connections/secrets-management). -- 🚀 [st.help](/develop/api-reference/utilities/st.help) has been revamped to show more information about object methods, attributes, classes, and more, which is great for debugging ([#5857](https://github.com/streamlit/streamlit/pull/5857), [#6382](https://github.com/streamlit/streamlit/pull/6382))! - -**Notable Changes** - -- 🪜 [st.time_input](/develop/api-reference/widgets/st.time_input) supports adding a stepping interval with the keyword-only `step` parameter ([#6071](https://github.com/streamlit/streamlit/pull/6071)). -- ❓ Most [text elements](/develop/api-reference/text) can include tooltips with the `help` parameter ([#6043](https://github.com/streamlit/streamlit/pull/6043)). -- ↔️ [st.pyplot](/develop/api-reference/charts/st.pyplot) has a `use_container_width` parameter to set the chart to the container width (now all [chart elements](/develop/api-reference/charts) support this parameter) ([#6067](https://github.com/streamlit/streamlit/pull/6067)). -- 👩‍💻 [st.code](/develop/api-reference/text/st.code) supports optionally displaying line numbers to the code block's left with the boolean `line_numbers` parameter ([#5756](https://github.com/streamlit/streamlit/issues/5756), [#6042](https://github.com/streamlit/streamlit/pull/6042)). -- ⚓ Anchors in header elements can be turned off by setting `anchor=False` ([#6158](https://github.com/streamlit/streamlit/pull/6158)). - -**Other Changes** - -- 🐼 [st.table](/develop/api-reference/data/st.table) and [st.dataframe](/develop/api-reference/data/st.dataframe) support `pandas.Period`, and number and boolean types in categorical columns ([#2547](https://github.com/streamlit/streamlit/issues/2547), [#5429](https://github.com/streamlit/streamlit/pull/5429), [#5329](https://github.com/streamlit/streamlit/issues/5392), [#6248](https://github.com/streamlit/streamlit/pull/6248)). -- 🕸️ Added `.webp` to the list of allowed static file extensions ([#6331](https://github.com/streamlit/streamlit/pull/6331)) -- 🐞 Bug fix: stop script execution on websocket close to immediately clear session information ([#6166](https://github.com/streamlit/streamlit/issues/6166), [#6204](https://github.com/streamlit/streamlit/pull/6204)). -- 🐜 Bug fixes: updated allowed/disallowed label markdown behavior such that unsupported elements are unwrapped and only their children (text contents) render ([#5872](https://github.com/streamlit/streamlit/issues/5872), [#6036](https://github.com/streamlit/streamlit/issues/6036), [#6054](https://github.com/streamlit/streamlit/issues/6054), [#6163](https://github.com/streamlit/streamlit/pull/6163)). -- 🪲 Bug fixes: don't push browser history states on rerun, use HTTPS to load external resources in `streamlit hello`, and make the browser back button work for multipage apps ([#5292](https://github.com/streamlit/streamlit/issues/5292), [#6266](https://github.com/streamlit/streamlit/pull/6266), [#6232](https://github.com/streamlit/streamlit/pull/6232)). Thanks, [whitphx](https://github.com/whitphx)! -- 🐝 Bug fix: avoid showing emoji on non-UTF-8 terminals. ([#2284](https://github.com/streamlit/streamlit/issues/2284), [#6088](https://github.com/streamlit/streamlit/pull/6088)). Thanks, [kcarnold](https://github.com/kcarnold)! -- 📁 Bug fix: override default use of [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API) for `react-dropzone` so that `st.file_uploader`'s File Selection Dialog only shows file types corresponding to those included in the `type` parameter ([#6176](https://github.com/streamlit/streamlit/issues/6176), [#6315](https://github.com/streamlit/streamlit/pull/6315)). -- 💾 Bug fix: make the `.clear()` method on cache-decorated functions work ([#6310](https://github.com/streamlit/streamlit/issues/6310), [#6321](https://github.com/streamlit/streamlit/pull/6321)). -- 🏃 Bug fix: `st.experimental_get_query_params` doesn't need reruns to work ([#6347](https://github.com/streamlit/streamlit/issues/6347), [#6348](https://github.com/streamlit/streamlit/pull/6348)). Thanks, [PaleNeutron](https://github.com/PaleNeutron)! -- 🐛 Bug fix: `CachedStFunctionWarning` mentions `experimental_allow_widgets` instead of the deprecated `suppress_st_warning` ([#6216](https://github.com/streamlit/streamlit/issues/6216), [#6217](https://github.com/streamlit/streamlit/pull/6217)). - -## **Version 1.20.0** - -_Release date: March 09, 2023_ - -**Notable Changes** - -- 🔐 Added support for configuring SSL to [serve apps directly over HTTPS](/develop/concepts/configuration/https-support) ([#5969](https://github.com/streamlit/streamlit/pull/5969)). -- 🖼️ Granular control over app embedding behavior with the `/?embed` and `/?embed_options` query parameters. Learn how to use this feature in our [docs](/deploy/streamlit-community-cloud/share-your-app/embed-your-app) ([#6011](https://github.com/streamlit/streamlit/pull/6011), [#6019](https://github.com/streamlit/streamlit/pull/6019)). -- ⚡ Enabled the `runner.fastReruns` [configuration option](/develop/concepts/configuration#view-all-configuration-options) by default to make apps much more responsive to user interaction ([#6200](https://github.com/streamlit/streamlit/pull/6200)). - -**Other Changes** - -- 🍔 Cleaned up the hamburger menu by removing the least used options ([#6080](https://github.com/streamlit/streamlit/pull/6080)). -- 🖨️ Design changes to ensure apps being printed or saved as a PDF look good ([#6180](https://github.com/streamlit/streamlit/pull/6180)). -- 🐞 Bug fix: improved `dtypes` checking in `st.experimental_data_editor` ([#6185](https://github.com/streamlit/streamlit/issues/6185), [#6188](https://github.com/streamlit/streamlit/pull/6188)). -- 🐛 Bug fix: properly position `st.metric`'s `help` tooltip when not inside columns ([#6168](https://github.com/streamlit/streamlit/pull/6168)). -- 🪲 Bug fix: regression in retrieving messages from the server's `ForwardMsgCache` ([#6210](https://github.com/streamlit/streamlit/pull/6210)). -- 🌀 Bug fix: `st.cache_data` docstring for the `show_spinner` param now lists `str` as a supported type ([#6207](https://github.com/streamlit/streamlit/issues/6207), [#6213](https://github.com/streamlit/streamlit/pull/6213)). -- ⏱️ Made ping and websocket timeouts far more forgiving ([#6212](https://github.com/streamlit/streamlit/pull/6212)). -- 🗺️ `st.map` and `st.pydeck_chart` docs state that Streamlit's Mapbox token will not work indefinitely ([#6143](https://github.com/streamlit/streamlit/pull/6143)). - -## **Version 1.19.0** - -_Release date: February 23, 2023_ - -**Highlights** - -- ✂️ Introducing `st.experimental_data_editor`, a widget that allows you to edit DataFrames and many other data structures in a table-like UI. Read more in our [documentation](/develop/concepts/design/dataframes) and [blog post](https://blog.streamlit.io/editable-dataframes-are-here/). - -**Other Changes** - -- ✨ Streamlit's GitHub README got a new look ([#6016](https://github.com/streamlit/streamlit/pull/6016)). -- 🌚 Improved readability of styled dataframe cells in dark mode ([#6060](https://github.com/streamlit/streamlit/issues/6060), [#6098](https://github.com/streamlit/streamlit/pull/6098)). -- 🐛 Bug fix: make apps work again in the latest versions of Safari, and in Chrome with third-party cookies blocked ([#6092](https://github.com/streamlit/streamlit/issues/6092), [#6094](https://github.com/streamlit/streamlit/pull/6094), [#6087](https://github.com/streamlit/streamlit/issues/6087), [#6100](https://github.com/streamlit/streamlit/pull/6100)). -- 🐞 Bug fix: refer to new cache primitives in the "Clear cache" dialog and error messages ([#6082](https://github.com/streamlit/streamlit/pull/6082), [#6128](https://github.com/streamlit/streamlit/pull/6128)). -- 🐝 Bug fix: properly cache class member functions and instance methods ([#6109](https://github.com/streamlit/streamlit/issues/6109), [#6114](https://github.com/streamlit/streamlit/pull/6114)). -- 🐜 Bug fix: regression in `st.metric` tooltip position ([#6093](https://github.com/streamlit/streamlit/issues/6093), [#6129](https://github.com/streamlit/streamlit/pull/6129)). -- 🪲 Bug fix: allow fullscreen button to show for dataframes, charts, etc, in expander ([#6083](https://github.com/streamlit/streamlit/pull/6083), [#6148](https://github.com/streamlit/streamlit/pull/6148)). - -## **Version 1.18.0** - -_Release date: February 09, 2023_ - -**Highlights** - -- 🎊 Introducing `@st.cache_data` and `@st.cache_resource` — two new caching commands to replace `st.cache`! Check out our [blog post](https://blog.streamlit.io/p/c0a90231-9848-47ec-a40c-ad4a344e4de1/) and [documentation](/develop/concepts/architecture/caching) for more information. - -**Notable Changes** - -- 🪆 `st.columns` supports up to one level of column nesting (i.e., columns inside columns) in the main area of the app. -- ⏳ `st.progress` supports adding a message to display above the progress bar with the `text` keyword parameter. -- ↔️ `st.button` has an optional `use_container_width` parameter to allow you to stretch buttons across the full container width. -- 🐍 We formally added support for Python 3.11. -- 🖨️ Save your app as a PDF via the "Print" option in your app's hamburger menu. -- 🛎️ Apps can serve small, static media files via the `enableStaticServing` config option. See our [documentation](/develop/concepts/configuration/serving-static-files) on how to use this feature and our demo [app](https://static-file-serving.streamlit.app/) for an example. - -**Other Changes** - -- 🏁 All Streamlit endpoints (including `/healthz`) have been renamed to have a consistent pattern and avoid any clashes with reserved endpoints of GCP (notably Cloud Run and App Engine) ([#5534](https://github.com/streamlit/streamlit/pull/5534)). -- ⚡ Improved caching performance when multiple sessions access an uncomputed cached value simultaneously ([#6017](https://github.com/streamlit/streamlit/pull/6017)). -- 🚧 Streamlit only displays deprecation warnings in the browser when the `client.showErrorDetails` config option is set to `True`. Deprecation warnings always get logged to the console, regardless of whether they're displayed in-browser ([#5945](https://github.com/streamlit/streamlit/pull/5945)). -- 🏓 Refactored the `st.dataframe` internals to improve dataframe handling and conversion, such as detecting more types, converting key-value dicts to dataframes, and more ([#6026](https://github.com/streamlit/streamlit/pull/6026), [#6023](https://github.com/streamlit/streamlit/pull/6023)). -- 💽 The behavior of widget labels when they are passed unsupported Markdown elements is documented ([#5978](https://github.com/streamlit/streamlit/pull/5978)). -- 📊 Bug fix: Plotly improvements — upgraded multiple frontend dependencies, including Plotly, to the latest version to properly redraw cached charts, make Plotly mapbox animations work, and allow users to update the figure layout when using the Streamlit theme ([#5885](https://github.com/streamlit/streamlit/pull/5885), [#5967](https://github.com/streamlit/streamlit/pull/5967), [#6055](https://github.com/streamlit/streamlit/pull/6055)). -- 📶 Bug fix: allow browser tabs that transiently disconnect (due to a network blip, load balancer timeout, etc.) to avoid losing all of their state ([#5856](https://github.com/streamlit/streamlit/pull/5856)). -- 📱 Bug fix: the keyboard is hidden on mobile when `st.selectbox` and `st.multiselect` have less than 10 options ([#5979](https://github.com/streamlit/streamlit/pull/5979)). -- 🐝 Bug fix: design tweaks to `st.metric`, `st.multiselect`, `st.tabs` , and menu items to prevent label overflow and scrolling issues, especially with small viewport sizes ([#5933](https://github.com/streamlit/streamlit/pull/5933), [#6034](https://github.com/streamlit/streamlit/pull/6034)). -- 🐞 Bug fix: switched to a functioning Twemoji URL from which page favicons are loaded in `st.set_page_config` ([#5943](https://github.com/streamlit/streamlit/pull/5943)). -- ✍️ More type hints ([#5986](https://github.com/streamlit/streamlit/pull/5986)). Thanks, [harahu](https://github.com/harahu)! - -## **Version 1.17.0** - -_Release date: January 12, 2023_ - -**Notable Changes** - -- 🪄 [`@st.experimental_singleton`](/develop/api-reference/caching-and-state/st.experimental_singleton#validating-the-cache) supports an optional `validate` parameter that accepts a validation function for cached data and is called each time the cached value is accessed. -- 💾  [`@st.experimental_memo`](/develop/api-reference/caching-and-state/st.experimental_memo)'s `persist` parameter can also accept booleans. - -**Other Changes** - -- 📟 Multipage apps exclude `__init__.py` from the page selector ([#5890](https://github.com/streamlit/streamlit/pull/5890)). -- 📐 The iframes of embedded apps have the ability to dynamically resize their height ([#5894](https://github.com/streamlit/streamlit/pull/5894)). -- 🐞 Bug fix: thumb values of range sliders respect the container width ([#5913](https://github.com/streamlit/streamlit/pull/5913)). -- 🪲 Bug fix: all examples in docstrings of Streamlit commands contain relevant imports to make them reproducible ([#5877](https://github.com/streamlit/streamlit/pull/5877)). - ---- - -# 2022 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2022 - - -This page contains release notes for Streamlit versions released in 2022. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## **Version 1.16.0** - -_Release date: December 14, 2022_ - -**Highlights** - -- 👩‍🎨 Introducing a new Streamlit theme for Altair, Plotly, and Vega-Lite charts! Check out our [blog post](https://blog.streamlit.io/a-new-streamlit-theme-for-altair-and-plotly/) for more information. -- 🎨 Streamlit now supports colored text in all commands that accept Markdown, including `st.markdown`, `st.header`, and more. Learn more in our [documentation](/develop/api-reference/text/st.markdown). - -**Notable Changes** - -- 🔁 Functions cached with `st.experimental_memo` or `st.experimental_singleton` can contain Streamlit media elements and forms. -- ⛄ All Streamlit commands that accept pandas DataFrames as input also support Snowpark and PySpark DataFrames. -- 🏷 [st.checkbox](/develop/api-reference/widgets/st.checkbox) and [st.metric](/develop/api-reference/data/st.metric) can customize how to hide their labels with the `label_visibility` parameter. - -**Other Changes** - -- 🗺️ `st.map` improvements: support for upper case columns and better exception messages ([#5679](https://github.com/streamlit/streamlit/pull/5679), [#5792](https://github.com/streamlit/streamlit/pull/5792)). -- 🐞 Bug fix: `st.plotly_chart` respects the figure's height attribute and the `use_container_width` parameter ([#5779](https://github.com/streamlit/streamlit/pull/5779)). -- 🪲 Bug fix: all commands with the `icon` parameter such as [st.error](/develop/api-reference/status/st.error), [st.warning](/develop/api-reference/status/st.warning), etc, can contain emojis with variant selectors ([#5583](https://github.com/streamlit/streamlit/pull/5583)). -- 🐝 Bug fix: prevent `st.camera_input` from jittering when resizing the browser window ([#5661](https://github.com/streamlit/streamlit/pull/5711)). -- 🐜 Bug fix: update exception layout to avoid overflow of stack traces ([#5700](https://github.com/streamlit/streamlit/pull/5700)). - -## **Version 1.15.0** - -_Release date: November 17, 2022_ - -**Notable Changes** - -- 💅 Widget labels can contain inline Markdown. See our [docs](/develop/api-reference/widgets) and demo [app](https://markdown-labels.streamlit.app/) for more info. -- 🎵 [`st.audio`](/develop/api-reference/media/st.audio) now supports playing audio data passed in as NumPy arrays with the keyword-only `sample_rate` parameter. -- 🔁 Functions cached with `st.experimental_memo` or `st.experimental_singleton` can contain Streamlit widgets using the `experimental_allow_widgets` parameter. This allows caching checkboxes, sliders, radio buttons, and more! - -**Other Changes** - -- 👩‍🎨 Design tweak to prevent jittering in sliders ([#5612](https://github.com/streamlit/streamlit/pull/5612)). -- 🐛 Bug fix: links in headers are red, not blue ([#5609](https://github.com/streamlit/streamlit/pull/5609)). -- 🐞 Bug fix: properly resize Plotly charts when exiting fullscreen ([#5645](https://github.com/streamlit/streamlit/pull/5645)). -- 🐝: Bug fix: don't accidentally trigger `st.balloons` and `st.snow` ([#5401](https://github.com/streamlit/streamlit/pull/5401)). - -## **Version 1.14.0** - -_Release date: October 27, 2022_ - -**Highlights** - -- 🎨 `st.button` and `st.form_submit_button` support designating buttons as "primary" (for additional emphasis) or "secondary" (for normal buttons) with the `type` keyword-only parameter. - -**Notable Changes** - -- 🤏 `st.multiselect` has a keyword-only `max_selections` parameter to limit the number of options that can be selected at a time. -- 📄 `st.form_submit_button` now has the `disabled` parameter that removes interactivity. - -**Other Changes** - -- 🏓 `st.dataframe` and `st.table` accept categorical intervals as input ([#5395](https://github.com/streamlit/streamlit/pull/5395)). -- ⚡ Performance improvements to Plotly charts ([#5542](https://github.com/streamlit/streamlit/pull/5542)). -- 🪲 Bug fix: `st.download_button` supports non-latin1 characters in filenames ([#5465](https://github.com/streamlit/streamlit/pull/5465)). -- 🐞 Bug fix: Allow `st.image` to render a local GIF as a GIF, not as a static PNG ([#5438](https://github.com/streamlit/streamlit/pull/5438)). -- 📱 Design tweaks to the sidebar in multipage apps ([#5538](https://github.com/streamlit/streamlit/pull/5538), [#5445](https://github.com/streamlit/streamlit/pull/5445), [#5559](https://github.com/streamlit/streamlit/pull/5559)). -- 📊 Improvements to the axis configuration for built-in charts ([#5412](https://github.com/streamlit/streamlit/pull/5412)). -- 🔧 Memo and singleton improvements: support text values for `show_spinner`, use `datetime.timedelta` objects as `ttl` parameter value, properly hash PIL images and `Enum` classes, show better error messages when returning unevaluated dataframes ([#5447](https://github.com/streamlit/streamlit/pull/5447), [#5413](https://github.com/streamlit/streamlit/pull/5413), [#5504](https://github.com/streamlit/streamlit/pull/5504), [#5426](https://github.com/streamlit/streamlit/pull/5426), [#5515](https://github.com/streamlit/streamlit/pull/5515)). -- 🔍 Zoom buttons in maps created with `st.map` and `st.pydeck_chart` use light or dark style based on the app's theme ([#5479](https://github.com/streamlit/streamlit/pull/5479)). -- 🗜 Websocket headers from the current session's incoming WebSocket request can be obtained from a new "internal" (i.e.: subject to change without deprecation) API ([#5457](https://github.com/streamlit/streamlit/pull/5457)). -- 📝 Improve the text that gets printed when you first install and use Streamlit ([#5473](https://github.com/streamlit/streamlit/pull/5473)). - -## **Version 1.13.0** - -_Release date: September 22, 2022_ - -**Notable Changes** - -- 🏷 Widgets can customize how to hide their labels with the `label_visibility` parameter. -- 🔍 `st.map` adds zoom buttons to the map by default. -- ↔️ `st.dataframe` supports the `use_container_width` parameter to stretch across the full container width. -- 🪄 Improvements to `st.dataframe` sizing: Column width calculation respects column headers, supports double click between column headers to autosize, better fullscreen support, and fixes the issue with the `width` parameter. - -**Other Changes** - -- ⌨️ `st.time_input` allows for keyboard-only input ([#5194](https://github.com/streamlit/streamlit/pull/5194)). -- 💿 `st.memo` will warn the user when using `ttl` and `persist` keyword argument together ([#5032](https://github.com/streamlit/streamlit/pull/5032)). -- 🔢 `st.number_input` returns consistent type after rerun ([#5359](https://github.com/streamlit/streamlit/pull/5359)). -- 🚒 `st.sidebar` UI fixes including a fix for scrollbars in Firefox browsers ([#5157](https://github.com/streamlit/streamlit/pull/5157), [#5324](https://github.com/streamlit/streamlit/pull/5324)). -- 👩‍💻 Improvements to usage metrics to guide API development. -- ✍️ More type hints! ([#5191](https://github.com/streamlit/streamlit/pull/5191), [#5192](https://github.com/streamlit/streamlit/pull/5192), [#5242](https://github.com/streamlit/streamlit/pull/5242), [#5243](https://github.com/streamlit/streamlit/pull/5243), [#5244](https://github.com/streamlit/streamlit/pull/5244), [#5245](https://github.com/streamlit/streamlit/pull/5245), [#5246](https://github.com/streamlit/streamlit/pull/5246)) Thanks [harahu](https://github.com/harahu)! - -## **Version 1.12.0** - -_Release date: August 11, 2022_ - -**Highlights** - -- 📊 Built-in charts (e.g. `st.line_chart`) get a brand-new look and parameters `x` and `y`! Check out our [blog post](https://blog.streamlit.io/built-in-charts-get-a-new-look-and-parameters/) for more information. - -**Notable Changes** - -- ⏯ Functions cached with `st.experimental_memo` or `st.experimental_singleton` can now contain static `st` commands. This allows caching text, charts, dataframes, and more! -- ↔️ The sidebar is now resizable via drag and drop. -- ☎️ `st.info`, `st.success`, `st.error`, and `st.warning` got a redesign and have a new keyword-only parameter: `icon`. - -**Other Changes** - -- 🎚️ `st.select_slider` correctly handles all floats now ([#4973](https://github.com/streamlit/streamlit/pull/4973), [#4978](https://github.com/streamlit/streamlit/pull/4978)). -- 🔢 `st.multi_select` can take values from enums ([#4987](https://github.com/streamlit/streamlit/pull/4987)). -- 🍊 `st.slider` range values can now be set through `st.session_state` ([#5007](https://github.com/streamlit/streamlit/pull/5007)). -- 🎨 `st.progress` got a redesign ([#5011](https://github.com/streamlit/streamlit/pull/5011), [#5086](https://github.com/streamlit/streamlit/pull/5086)). -- 🔘 `st.radio` better deals with list-like dataframes ([#5021](https://github.com/streamlit/streamlit/pull/5021)). -- 🧞‍♂️ `st.cache` properly handles JSON files now ([#5023](https://github.com/streamlit/streamlit/pull/5023)). -- ⚓️ Headers render markdown now when the `anchor` parameter is set ([#5038](https://github.com/streamlit/streamlit/pull/5038)). -- 🗻 `st.image` can now load SVGs from Inkscape ([#5040](https://github.com/streamlit/streamlit/pull/5040)). -- 🗺️ `st.map` and `st.pydeck_chart` use light or dark style based on the app's theme ([#5074](https://github.com/streamlit/streamlit/pull/5074), [#5108](https://github.com/streamlit/streamlit/pull/5108)). -- 🎈 Clicks on elements below `st.balloons` and `st.snow` don't get blocked anymore ([#5098](https://github.com/streamlit/streamlit/pull/5098)). -- 🔝 Embedded apps have lower top padding ([#5111](https://github.com/streamlit/streamlit/pull/5111)). -- 💅 Adjusted padding and alignment for widgets, charts, and dataframes ([#4995](https://github.com/streamlit/streamlit/pull/4995), [#5061](https://github.com/streamlit/streamlit/pull/5061), [#5081](https://github.com/streamlit/streamlit/pull/5081)). -- ✍️ More type hints! ([#4926](https://github.com/streamlit/streamlit/pull/4926), [#4932](https://github.com/streamlit/streamlit/pull/4932), [#4933](https://github.com/streamlit/streamlit/pull/4933)) - -## **Version 1.11.0** - -_Release date: July 14, 2022_ - -**Highlights** - -- 🗂 Introducing `st.tabs` to have tab containers in your app. See our [documentation](/develop/api-reference/layout/st.tabs) on how to use this feature. - -**Notable Changes** - -- ℹ️ `st.metric` supports tooltips with the `help` keyword parameter. -- 🚇 `st.columns` supports setting the gap size between columns with the `gap` keyword parameter. - -**Other Changes** - -- 💅 Design tweaks to `st.selectbox`, `st.expander`, `st.spinner` ([#4801](https://github.com/streamlit/streamlit/pull/4801)). -- 📱 The sidebar will close when users select a page from the navigation menu on mobile devices ([#4851](https://github.com/streamlit/streamlit/pull/4841)). -- 🧠 `st.memo` supports dataclasses! ([#4850](https://github.com/streamlit/streamlit/pull/4850)) -- 🏎 Bug fix for a race condition that destroyed widget state with rapid interaction ([#4882](https://github.com/streamlit/streamlit/pull/4882)). -- 🏓 `st.table` presents overflowing content to be scrollable when placed inside columns and expanders ([#4934](https://github.com/streamlit/streamlit/pull/4934)). -- 🐍 Types: More updated type annotations across Streamlit! ([#4808](https://github.com/streamlit/streamlit/pull/4808), [#4809](https://github.com/streamlit/streamlit/pull/4809), [#4856](https://github.com/streamlit/streamlit/pull/4856)) - -## **Version 1.10.0** - -_Release date: June 2, 2022_ - -**Highlights** - -- 📖 Introducing native support for multipage apps! Check out our [blog post](https://blog.streamlit.io/introducing-multipage-apps) and try out our new `streamlit hello`. - -**Notable Changes** - -- ✨ `st.dataframe` has been redesigned. -- 🔘 `st.radio` has a `horizontal` keyword-only parameter to display options horizontally. -- ⚠️ Streamlit Community Cloud will support richer exception formatting. -- 🏂 Get user information on private apps using `st.experimental_user`. - -**Other Changes** - -- 📊 Upgraded Vega-Lite library to support even more interactive charting improvements. See their [release notes](https://github.com/vega/vega-lite/releases) to find out more. ([#4751](https://github.com/streamlit/streamlit/pull/4751)). -- 📈 `st.vega_lite_chart` will respond to updates, particularly in response to input widgets ([#4736](https://github.com/streamlit/streamlit/pull/4736)). -- 💬 `st.markdown` with long text will always wrap ([#4696](https://github.com/streamlit/streamlit/pull/4696)). -- 📦 Support for [PDM](https://pdm.fming.dev/) ([#4724](https://github.com/streamlit/streamlit/pull/4724)). -- ✍️ Types: Updated type annotations across Streamlit! ([#4679](https://github.com/streamlit/streamlit/pull/4679), [#4680](https://github.com/streamlit/streamlit/pull/4680), [#4681](https://github.com/streamlit/streamlit/pull/4681), [#4682](https://github.com/streamlit/streamlit/pull/4682), [#4683](https://github.com/streamlit/streamlit/pull/4683), [#4684](https://github.com/streamlit/streamlit/pull/4684), [#4685](https://github.com/streamlit/streamlit/pull/4685), [#4686](https://github.com/streamlit/streamlit/pull/4686), [#4687](https://github.com/streamlit/streamlit/pull/4687), [#4688](https://github.com/streamlit/streamlit/pull/4688), [#4690](https://github.com/streamlit/streamlit/pull/4690), [#4703](https://github.com/streamlit/streamlit/pull/4703), [#4704](https://github.com/streamlit/streamlit/pull/4704), [#4705](https://github.com/streamlit/streamlit/pull/4705), [#4706](https://github.com/streamlit/streamlit/pull/4706), [#4707](https://github.com/streamlit/streamlit/pull/4707), [#4708](https://github.com/streamlit/streamlit/pull/4708), [#4710](https://github.com/streamlit/streamlit/pull/4710), [#4723](https://github.com/streamlit/streamlit/pull/4723), [#4733](https://github.com/streamlit/streamlit/pull/4733)). - -## **Version 1.9.0** - -_Release date: May 4, 2022_ - -**Notable Changes** - -- 🪗 `st.json` now supports a keyword-only argument, `expanded` on whether the JSON should be expanded by default (defaults to `True`). -- 🏃‍♀️ More performance improvements from reducing redundant work each script run. - -**Other Changes** - -- 🏇 Widgets when `disabled` is set/unset will maintain its value ([#4527](https://github.com/streamlit/streamlit/pull/4527)). -- 🧪 Experimental feature to increase the speed of reruns using configuration `runner.fastReruns`. See [#4628](https://github.com/streamlit/streamlit/pull/4628) for the known issues in enabling this feature. -- 🗺️ DataFrame timestamps support UTC offset (in addition to time zone notation) ([#4669](https://github.com/streamlit/streamlit/pull/4669)). - -## **Version 1.8.0** - -_Release date: March 24, 2022_ - -**Notable Changes** - -- 🏃‍♀️ Dataframes should see performance improvements ([#4463](https://github.com/streamlit/streamlit/pull/4463)). - -**Other Changes** - -- 🕰 `st.slider` handles timezones better by removing timezone conversions on the backend ([#4348](https://github.com/streamlit/streamlit/pull/4358)). -- 👩‍🎨 Design improvements to our header ([#4496](https://github.com/streamlit/streamlit/pull/4496)). - -## **Version 1.7.0** - -_Release date: March 3, 2022_ - -**Highlights** - -- Introducing `st.snow`, celebrating our acquisition by Snowflake! See more information in [our blog post](https://blog.streamlit.io/snowflake-to-acquire-streamlit/). - -## **Version 1.6.0** - -_Release date: Feb 24, 2022_ - -**Other Changes** - -- 🗜 WebSocket compression is now disabled by default, which will improve CPU and latency performance for large dataframes. You can use the `server.enableWebsocketCompression` configuration option to re-enable it if you find the increased network traffic more impactful. -- ☑️ 🔘 Radio and checkboxes improve focus on Keyboard navigation ([#4308](https://github.com/streamlit/streamlit/pull/4308)). - -## **Version 1.5.0** - -_Release date: Jan 27, 2022_ - -**Notable Changes** - -- 🌟 Favicon defaults to a PNG to allow for transparency ([#4272](https://github.com/streamlit/streamlit/pull/4272)). -- 🚦 Select Slider Widget now has the `disabled` parameter that removes interactivity (completing all of our widgets) ([#4314](https://github.com/streamlit/streamlit/pull/4314)). - -**Other Changes** - -- 🔤 Improvements to our markdown library to provide better support for HTML (specifically nested HTML) ([#4221](https://github.com/streamlit/streamlit/pull/4221)). -- 📖 Expanders maintain their expanded state better when multiple expanders are present ([#4290](https://github.com/streamlit/streamlit/pull/4290)). -- 🗳 Improved file uploader and camera input to call its `on_change` handler only when necessary ([#4270](https://github.com/streamlit/streamlit/pull/4270)). - -## **Version 1.4.0** - -_Release date: Jan 13, 2022_ - -**Highlights** - -- 📸 Introducing `st.camera_input` for uploading images straight from your camera. - -**Notable Changes** - -- 🚦 Widgets now have the `disabled` parameter that removes interactivity. -- 🚮 Clear `st.experimental_memo` and `st.experimental_singleton` programmatically by using the `clear()` method on a cached function. -- 📨 Developers can now configure the maximum size of a message to accommodate larger messages within the Streamlit application. See `server.maxMessageSize`. -- 🐍 We formally added support for Python 3.10. - -**Other Changes** - -- 😵‍💫 Calling `str` or `repr` on `threading.current_thread()` does not cause a RecursionError ([#4172](https://github.com/streamlit/streamlit/issues/4172)). -- 📹 Gracefully stop screencast recording when user removes permission to record ([#4180](https://github.com/streamlit/streamlit/pull/4180)). -- 🌇 Better scale images by using a higher-quality image bilinear resampling algorithm ([#4159](https://github.com/streamlit/streamlit/pull/4159)). - ---- - -# 2021 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2021 - - -This page contains release notes for Streamlit versions released in 2021. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## Version 1.3.0 - -_Release date: Dec 16, 2021_ - -**Notable Changes** - -- 💯 Support for NumPy values in `st.metric`. -- 🌐 Support for Mesh Layers in PyDeck. -- 📊 Updated Plotly chart version to support the latest features. -- 🏀 `st.spinner` element has visual animated spinner. -- 🍰 `st.caption` supports HTML in text with `unsafe_allow_html` parameter. - -**Other Changes** - -- 🪲 Bug fix: Allow `st.session_state` to be used to set number_input values with no warning ([#4047](https://github.com/streamlit/streamlit/pull/4047)). -- 🪲 Bug fix: Fix footer alignment in wide mode ([#4035](https://github.com/streamlit/streamlit/pull/4035)). -- 🐞 Bug fix: Better support for Graphviz and Bokeh charts in containers (columns, expanders, etc.) ([#4039](https://github.com/streamlit/streamlit/pull/4039)). -- 🐞 Bug fix: Support inline data values in Vega-Lite ([#4070](https://github.com/streamlit/streamlit/pull/4070)). -- ✍️ Types: Updated type annotations for experimental memo and singleton decorators. -- ✍️ Types: Improved type annotations for `st.selectbox`, `st.select_slider`, `st.radio`, `st.number_input`, and `st.multiselect`. - -## Version 1.2.0 - -_Release date: Nov 11, 2021_ - -**Notable Changes** - -- ✏️ `st.text_input` and `st.text_area` now have a `placeholder` parameter to display text when the field is empty. -- 📏 Viewers can now resize the input box in `st.text_area`. -- 📁 Streamlit can auto-reload when files in sub-directories change. -- 🌈 We've upgraded Bokeh support to 2.4.1! We recommend updating your Bokeh library to 2.4.1 to maintain functionality. Going forward, we'll let you know if there's a mismatch in your Bokeh version via an error prompt. -- 🔒 Developers can access secrets via attribute notation (e.g. `st.secrets.key` vs `st.secrets["key"]`) just like session state. -- ✍️ Publish type annotations according to [PEP 561](https://mypy.readthedocs.io/en/stable/installed_packages.html). Users now get type annotations for Streamlit when running mypy ([#4025](https://github.com/streamlit/streamlit/pull/4025)). - -**Other Changes** - -- 👀 Visual fixes ([#3863](https://github.com/streamlit/streamlit/pull/3863), [#3995](https://github.com/streamlit/streamlit/pull/3995), [#3926](https://github.com/streamlit/streamlit/pull/3926), [#3975](https://github.com/streamlit/streamlit/pull/3975)). -- 🍔 Fixes to the hamburger menu ([#3968](https://github.com/streamlit/streamlit/pull/3968)). -- 🖨️ Ability to print session state ([#3970](https://github.com/streamlit/streamlit/pull/3970)). - -## Version 1.1.0 - -_Release date: Oct 21, 2021_ - -**Highlights** - -- 🧠 Memory improvements: Streamlit apps allocate way less memory over time now. - -**Notable Changes** - -- ♻️ Apps automatically rerun now when the content of `secrets.toml` changes (before this you had to refresh the page manually). - -**Other Changes** - -- 🔗 Redirected some links to our [brand-new docs site](https://docs.streamlit.io/), e.g. in exceptions. -- 🪲 Bug fix: Allow initialization of range slider with session state ([#3586](https://github.com/streamlit/streamlit/issues/3586)). -- 🐞 Bug fix: Refresh chart when using `add_rows` with `datetime` index ([#3653](https://github.com/streamlit/streamlit/issues/3653)). -- ✍️ Added some more type annotation in our codebase ([#3908](https://github.com/streamlit/streamlit/issues/3908)). - -## Version 1.0.0 - -_Release date: Oct 5, 2021_ - -**Highlights** - -- 🎈Announcing Streamlit 1.0! To read more about check out our [1.0 blog post](https://blog.streamlit.io/announcing-streamlit-1-0/). - -**Other Changes** - -- 🐞 Fixed an issue where using `df.dtypes` to show datatypes for a DF fails while using Arrow ([#3709](https://github.com/streamlit/streamlit/issues/3709)), Image captions stay within image width and are readable ([#3530](https://github.com/streamlit/streamlit/issues/3530)). - -## Version 0.89.0 - -_Release date: Sep 22, 2021_ - -**Highlights** - -- 💰 Introducing `st.experimental_memo` and `experimental_singleton`, a new primitive for caching! See [our blog post](https://blog.streamlit.io/new-experimental-primitives-for-caching/). -- 🍔 Streamlit allows developers to configure their hamburger menu to be more user-centric. - -**Notable Changes** - -- 💅 We updated our UI to a more polished look with a new font. -- 🎨 We now support `theme.base` in the theme object when it's sent to custom components. -- 🧠 We've modified session state to reset widgets if any of their arguments changed even if they provide a key. - - Some widget behavior may have changed, but we believe this change makes the most sense. We have added a section to [our documentation](/develop/concepts/widget-semantics) describing how they behave. - -**Other Changes** - -- 🐞 Bug fixes: Support svgs from a URL ([#3809](https://github.com/streamlit/streamlit/pull/3809)) and that do not start with `` tag ([#3789](https://github.com/streamlit/streamlit/pull/3789)). - -## Version 0.88.0 - -_Release date: Sep 2, 2021_ - -**Highlights** - -- ⬇️ Introducing `st.download_button`, a new button widget for easily downloading files. - -**Notable Changes** - -- 🛑 We made changes to improve the redacted exception experience on Streamlit Community Cloud. When `client.showErrorDetails=true` exceptions display the Error Type and the Traceback, but redact the actual error text to prevent data leaks. - -## Version 0.87.0 - -_Release date: Aug 19, 2021_ - -**Highlights** - -- 🔢 Introducing `st.metric`, an API for displaying KPIs. Check out the [demo app](https://streamlit-release-demos-0-87streamlit-app-0-87-rfzphf.streamlit.app/) showcasing the functionality. - -**Other Changes** - -- 🐞 **Bug Fixes**: File uploader retains state upon expander closing ([#3557](https://github.com/streamlit/streamlit/issues/3557)), setIn Error with `st.empty` ([#3659](https://github.com/streamlit/streamlit/issues/3659)), Missing IFrame embeds in docs ([#3706](https://github.com/streamlit/streamlit/issues/3706)), Fix error writing certain PNG files ([#3597](https://github.com/streamlit/streamlit/issues/3597)). - -## Version 0.86.0 - -_Release date: Aug 5, 2021_ - -**Highlights** - -- 🎓 Our layout primitives are graduating from beta! You can now use `st.columns`, `st.container` and `st.expander` without the `beta_` prefix. - -**Notable Changes** - -- 📱 When using `st.columns`, columns will stack vertically when viewport size \ - ---- - -# 2020 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2020 - - -This page contains release notes for Streamlit versions released in 2020. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## Version 0.73.0 - -_Release date: December 17, 2020_ - -**Notable Changes** - -- 🐍 Streamlit can now be installed on Python 3.9. Streamlit components are not - yet compatible with Python 3.9 and must use version 3.8 or earlier. -- 🧱 Streamlit Components now allows same origin, enabling features provided by - the browser such as a webcam component. -- 🐙 Fix Streamlit sharing deploy experience for users running on Git versions - 2.7.0 or earlier. -- 🧰 Handle unexpected closing of uploaded files for [`st.file_uploader`](https://docs.streamlit.io/en/0.72.0/api.html#streamlit.file_uploader). - -## Version 0.72.0 - -_Release date: December 2, 2020_ - -**Notable Changes** - -- 🌈 Establish a framework for theming and migrate existing components. -- 📱 Improve the sidebar experience for mobile devices. -- 🧰 Update [`st.file_uploader`](https://docs.streamlit.io/en/0.71.0/api.html#streamlit.file_uploader) to reduce reruns. - -## Version 0.71.0 - -_Release date: November 11, 2020_ - -**Notable Changes** - -- 📁 Updated [`st.file_uploader`](https://docs.streamlit.io/en/0.71.0/api.html#streamlit.file_uploader) - to automatically reset buffer on app reruns. -- 📊 Optimize the default rendering of charts and reduce issues with the initial render. - -## Version 0.70.0 - -_Release date: October 28, 2020_ - -**Notable Changes** - -- 🧪 [`st.set_page_config`](https://docs.streamlit.io/en/0.70.0/api.html#streamlit.set_page_config) and [`st.color_picker`](https://docs.streamlit.io/en/0.70.0/api.html#streamlit.color_picker) have now been moved into the - Streamlit namespace. These will be removed from beta January 28th, 2021. Learn - more about our beta process [here](https://docs.streamlit.io/en/0.70.0/api.html#beta-and-experimental-features). -- 📊 Improve display of bar charts for discrete values. - -## Version 0.69.0 - -_Release date: October 15, 2020_ - -**Highlights:** - -- 🎁 Introducing Streamlit sharing, the best way to deploy, manage, and share your public Streamlit apps—for free. Read more about it on our [blog post](http://blog.streamlit.io/introducing-streamlit-sharing/) or sign up [here](https://streamlit.io/sharing)! -- Added `st.experimental_rerun` to programatically re-run your app. Thanks [SimonBiggs](https://github.com/SimonBiggs)! - -**Notable Changes** - -- 📹 Better support across browsers for start and stop times for st.video. -- 🖼 Bug fix for intermittently failing media files -- 📦 Bug fix for custom components compatibility with Safari. Make sure to upgrade to the latest [streamlit-component-lib](https://www.npmjs.com/package/streamlit-component-lib). - -## Version 0.68.0 - -_Release date: October 8, 2020_ - -**Highlights:** - -- ⌗ Introducing new layout options for Streamlit! Move aside, vertical layout. - Make a little space for... horizontal layout! Check out our - [blog post](https://blog.streamlit.io/introducing-new-layout-options-for-streamlit/). -- 💾 File uploader redesigned with new functionality for multiple files uploads - and better support for working with uploaded files. This may cause breaking - changes. Please see the new api in our - [documentation](https://docs.streamlit.io/en/0.68.0/api.html#streamlit.file_uploader) - -**Notable Changes** - -- 🎈 `st.balloon` has gotten a facelift with nicer balloons and smoother animations. -- 🚨 Breaking Change: Following the deprecation of `st.deck_gl_chart` in - January 2020, we have now removed the API completely. Please use - `st.pydeck_chart` instead. -- 🚨 Breaking Change: Following the deprecation of `width` and `height` for - `st.altair_chart`, `st.graphviz_chart`, `st.plotly_chart`, and - `st.vega_lite_chart` in January 2020, we have now removed the args completely. - Please set the width and height in the respective charting library. - -## Version 0.67.0 - -_Release date: September 16, 2020_ - -**Highlights:** - -- 🦷 Streamlit Components can now return bytes to your Streamlit App. To create a - component that returns bytes, make sure to upgrade to the latest - [streamlit-component-lib](https://www.npmjs.com/package/streamlit-component-lib). - -**Notable Changes** - -- 📈 Deprecation warning: Beginning December 1st, 2020 `st.pyplot()` will require a figure to - be provided. To disable the deprecation warning, please set `deprecation.showPyplotGlobalUse` - to `False` -- 🎚 `st.multiselect` and `st.select` are now lightning fast when working with large datasets. Thanks [masa3141](https://github.com/masa3141)! - -## Version 0.66.0 - -_Release date: September 1, 2020_ - -**Highlights:** - -- ✏️ `st.write` is now available for use in the sidebar! -- 🎚 A slider for distinct or non-numerical values is now available with `st.select_slider`. -- ⌗ Streamlit Components can now return dataframes to your Streamlit App. Check out our [SelectableDataTable example](https://github.com/streamlit/component-template/tree/master/examples/SelectableDataTable). -- 📦 The Streamlit Components library used in our Streamlit Component template is - now available as a npm package ([streamlit-component-lib](https://www.npmjs.com/package/streamlit-component-lib)) to simplify future upgrades to the latest version. - Existing components do not need to migrate. - -**Notable Changes** - -- 🐼 Support StringDtype from pandas version 1.0.0 -- 🧦 Support for running Streamlit on Unix sockets - -## Version 0.65.0 - -_Release date: August 12, 2020_ - -**Highlights:** - -- ⚙️ Ability to set page title, favicon, sidebar state, and wide mode via st.beta_set_page_config(). See our [documentation](https://docs.streamlit.io/en/0.65.0/api.html#streamlit.set_page_config) for details. -- 📝 Add stateful behaviors through the use of query parameters with st.experimental_set_query_params and st.experimental_get_query_params. Thanks [@zhaoooyue](https://github.com/zhaoooyue)! -- 🐼 Improved pandas dataframe support for st.radio, st.selectbox, and st.multiselect. -- 🛑 Break out of your Streamlit app with st.stop. -- 🖼 Inline SVG support for st.image. - -**Callouts:** - -- 🚨Deprecation Warning: The st.image parameter format has been renamed to output_format. - -## Version 0.64.0 - -_Release date: July 23, 2020_ - -**Highlights:** - -- 📊 Default matplotlib to display charts with a tight layout. To disable this, - set `bbox_inches` to `None`, inches as a string, or a `Bbox` -- 🗃 Deprecation warning for automatic encoding on `st.file_uploader` -- 🙈 If `gatherUserStats` is `False`, do not even load the Segment library. - Thanks [@tanmaylaud](https://github.com/tanmaylaud)! - -## Version 0.63.0 - -_Release date: July 13, 2020_ - -**Highlights:** - -- 🧩 **Support for Streamlit Components!!!** See - [documentation](https://docs.streamlit.io/en/latest/streamlit_components.html) for more info. -- 🕗 Support for datetimes in - [`st.slider`](https://docs.streamlit.io/en/latest/api.html#streamlit.slider). And, of course, just - like any other value you use in `st.slider`, you can also pass in two-element lists to get a - datetime range slider. - -## Version 0.62.0 - -_Release date: June 21, 2020_ - -**Highlights:** - -- 📨 Ability to turn websocket compression on/off via the config option - `server.enableWebsocketCompression`. This is useful if your server strips HTTP headers and you do - not have access to change that behavior. -- 🗝️ Out-of-the-box support for CSRF protection using the - [Cookie-to-header token](https://en.wikipedia.org/wiki/Cross-site_request_forgery#Cookie-to-header_token) - technique. This means that if you're serving your Streamlit app from multiple replicas you'll need - to configure them to to use the same cookie secret with the `server.cookieSecret` config option. - To turn XSRF protection off, set `server.enableXsrfProtection=false`. - -**Notable bug fixes:** - -- 🖼️ Added a grace period to the image cache expiration logic in order to fix multiple related bugs - where images sent with `st.image` or `st.pyplot` were sometimes missing. - -## Version 0.61.0 - -_Release date: June 2, 2020_ - -**Highlights:** - -- 📅 Support for date ranges in `st.date_picker`. See - [docs](https://docs.streamlit.io/en/latest/api.html#streamlit.date_picker) - for more info, but the TLDR is: just pass a list/tuple as the default date and it will be - interpreted as a range. -- 🗣️ You can now choose whether `st.echo` prints the code above or below the output of the echoed - block. To learn more, refer to the `code_location` argument in the - [docs](https://docs.streamlit.io/en/latest/api.html#streamlit.echo). -- 📦 Improved `@st.cache` support for Keras models and Tensorflow `saved_models`. - -## Version 0.60.0 - -_Release date: May 18, 2020_ - -**Highlights:** - -- ↕️ Ability to set the height of an `st.text_area` with the `height` argument - (expressed in pixels). See - [docs](https://docs.streamlit.io/en/latest/api.html#streamlit.text_area) for more. -- 🔡 Ability to set the maximimum number of characters allowed in `st.text_area` - or `st.text_input`. Check out the `max_chars` argument in the - [docs](https://docs.streamlit.io/en/latest/api.html#streamlit.text_area). -- 🗺️ Better DeckGL support for the [H3](https://h3geo.org/) geospatial indexing - system. So now you can use things like `H3HexagonLayer` in - [`st.pydeck_chart`](https://docs.streamlit.io/en/latest/api.html#streamlit.pydeck_chart). -- 📦 Improved `@st.cache` support for PyTorch TensorBase and Model. - -## Version 0.59.0 - -_Release date: May 05, 2020_ - -**Highlights:** - -- 🎨 New color-picker widget! Use it with - [`st.beta_color_picker()`](https://docs.streamlit.io/en/0.69.0/api.html#streamlit.beta_color_picker) -- 🧪 Introducing `st.beta_*` and `st.experimental_*` function prefixes, for faster - Streamlit feature releases. See - [docs](https://docs.streamlit.io/en/latest/api.html#pre-release-features) for more info. -- 📦 Improved `@st.cache` support for SQL Alchemy objects, CompiledFFI, PyTorch - Tensors, and `builtins.mappingproxy`. - -## Version 0.58.0 - -_Release date: April 22, 2020_ - -**Highlights:** - -- 💼 Made `st.selectbox` filtering case-insensitive. -- ㈬ Better support for Tensorflow sessions in `@st.cache`. -- 📊 Changed behavior of `st.pyplot` to auto-clear the figure only when using - the global Matplotlib figure (i.e. only when calling `st.pyplot()` rather - than `st.pyplot(fig)`). - -## Version 0.57.0 - -_Release date: March 26, 2020_ - -**Highlights:** - -- ⏲️ Ability to set expiration options for `@st.cache`'ed functions by setting - the `max_entries` and `ttl` arguments. See - [docs](https://docs.streamlit.io/en/latest/api.html#streamlit.cache). -- 🆙 Improved the machinery behind `st.file_uploader`, so it's much more - performant now! Also increased the default upload limit to 200MB - (configurable via `server.max_upload_size`). -- 🔒 The `server.address` config option now _binds_ the server to that address - for added security. -- 📄 Even more details added to error messages for `@st.cache` for easier - debugging. - -## Version 0.56.0 - -_Release date: February 15, 2020_ - -**Highlights:** - -- 📄 Improved error messages for st.cache. The errors now also point to the new - caching docs we just released. Read more - [here](https://discuss.streamlit.io/t/help-us-stress-test-streamlit-s-latest-caching-update/1944)! - -**Breaking changes:** - -- 🐍 As [announced last month](https://discuss.streamlit.io/t/streamlit-will-deprecate-python-2-in-february/1656), - **Streamlit no longer supports Python 2.** To use Streamlit you'll need - Python 3.5 or above. - -## Version 0.55.0 - -_Release date: February 4, 2020_ - -**Highlights:** - -- 📺 **Ability to record screencasts directly from Streamlit!** This allows - you to easily record and share explanations about your models, analyses, - data, etc. Just click ☰ then "Record a screencast". Give it a try! - -## Version 0.54.0 - -_Release date: January 29, 2020_ - -**Highlights:** - -- ⌨️ Support for password fields! Just pass `type="password"` to - `st.text_input()`. - -**Notable fixes:** - -- ✳️ Numerous st.cache improvements, including better support for complex objects. -- 🗣️ Fixed cross-talk in sidebar between multiple users. - -**Breaking changes:** - -- If you're using the SessionState hack Gist, you should re-download it! - Depending on which hack you're using, here are some links to save you some - time: - - [SessionState.py](https://gist.github.com/tvst/036da038ab3e999a64497f42de966a92) - - [st_state_patch.py](https://gist.github.com/tvst/0899a5cdc9f0467f7622750896e6bd7f) - -## Version 0.53.0 - -_Release date: January 14, 2020_ - -**Highlights:** - -- 🗺️ Support for all DeckGL features! Just use - [Pydeck](https://deckgl.readthedocs.io/en/latest/) instead of - [`st.deck_gl_chart`](https://docs.streamlit.io/en/latest/api.html#streamlit.pydeck_chart). - To do that, simply pass a PyDeck object to - [`st.pydeck_chart`](https://docs.streamlit.io/en/latest/api.html#streamlit.pydeck_chart), - [`st.write`](https://docs.streamlit.io/en/latest/api.html#streamlit.write), - or [magic](https://docs.streamlit.io/en/latest/api.html#magic). - - _Note that as a **preview release** things may change in the near future. - Looking forward to hearing input from the community before we stabilize the - API!_ - - **The goals is for this to replace `st.deck_gl_chart`,** since it - is does everything the old API did _and much more!_ - -- 🆕 Better handling of Streamlit upgrades while developing. We now auto-reload - the browser tab if the app it is displaying uses a newer version of Streamlit - than the one the tab is running. - -- 👑 New favicon, with our new logo! - -**Notable fixes:** - -- Magic now works correctly in Python 3.8. It no longer causes - docstrings to render in your app. - -**Breaking changes:** - -- Updated how we calculate the default width and height of all chart types. - We now leave chart sizing up to your charting library itself, so please refer - to the library's documentation. - - As a result, the `width` and `height` arguments have been deprecated - from most chart commands, and `use_container_width` has been introduced - everywhere to allow you to make charts fill as much horizontal space as - possible (this used to be the default). - ---- - -# 2019 release notes - -Source: https://docs.streamlit.io/develop/quick-reference/release-notes/2019 - - -This page contains release notes for Streamlit versions released in 2019. For the latest version of Streamlit, see [Release notes](/develop/quick-reference/release-notes). - -## Version 0.52.0 - -_Release date: December 20, 2019_ - -**Highlights:** - -- 📤 Preview release of the file uploader widget. To try it out just call - [`st.file_uploader`](https://docs.streamlit.io/en/latest/api.html#streamlit.file_uploader)! - - _Note that as a **preview release** things may change in the near future. - Looking forward to hearing input from the community before we stabilize the - API!_ - -- 👋 Support for [emoji codes](https://www.webfx.com/tools/emoji-cheat-sheet/) in - `st.write` and `st.markdown`! Try it out with `st.write("Hello :wave:")`. - -**Breaking changes:** - -- 🧹 `st.pyplot` now clears figures by default, since that's what you want 99% of - the time. This allows you to create two or more Matplotlib charts without - having to call - [`pyplot.clf`](https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.clf.html) - every time. If you want to turn this behavior off, use - [`st.pyplot(clear_figure=False)`](https://docs.streamlit.io/en/latest/api.html#streamlit.pyplot) -- 📣 `st.cache` no longer checks for input mutations. This is the first change - of our ongoing effort to simplify the caching system and prepare Streamlit - for the launch of other caching primitives like Session State! - -## Version 0.51.0 - -_Release date: November 30, 2019_ - -**Highlights:** - -- 🐕 You can now tweak the behavior of the file watcher with the config option `server.fileWatcherType`. Use it to switch between: - - `auto` (default) : Streamlit will attempt to use the watchdog module, and - falls back to polling if watchdog is not available. - - `watchdog` : Force Streamlit to use the watchdog module. - - `poll` : Force Streamlit to always use polling. - - `none` : Streamlit will not watch files. - -**Notable bug fixes:** - -- Fix the "keyPrefix" option in static report sharing [#724](https://github.com/streamlit/streamlit/pull/724) -- Add support for getColorX and getTargetColorX to DeckGL Chart [#718](https://github.com/streamlit/streamlit/pull/718) -- Fixing Tornado on Windows + Python 3.8 [#682](https://github.com/streamlit/streamlit/pull/682) -- Fall back on webbrowser if xdg-open is not installed on Linux [#701](https://github.com/streamlit/streamlit/pull/701) -- Fixing number input spin buttons for Firefox [#683](https://github.com/streamlit/streamlit/pull/683) -- Fixing CTRL+ENTER on Windows [#699](https://github.com/streamlit/streamlit/pull/699) -- Do not automatically create credential file when in headless mode [#467](https://github.com/streamlit/streamlit/pull/467) - -## Version 0.50.1 - -_Release date: November 10, 2019_ - -**Highlights:** - -- 👩‍🎓 SymPy support and ability to draw mathematical expressions using LaTeX! See - [`st.latex`](/develop/api-reference/text/st.latex), - [`st.markdown`](/develop/api-reference/text/st.markdown), - and - [`st.write`](/develop/api-reference/write-magic/st.write). -- 🌄 You can now set config options using environment variables. For example, - `export STREAMLIT_SERVER_PORT=9876`. -- 🐱 Ability to call `streamlit run` directly with Github and Gist URLs. No - need to grab the "raw" URL first! -- 📃 Cleaner exception stack traces. We now remove all Streamlit-specific code - from stack traces originating from the user's app. - -## Version 0.49.0 - -_Release date: October 23, 2019_ - -**Highlights:** - -- 💯 New input widget for entering numbers with the keyboard: `st.number_input()` -- 📺 Audio/video improvements: ability to load from a URL, to embed YouTube - videos, and to set the start position. -- 🤝 You can now (once again) share static snapshots of your apps to S3! See - the S3 section of `streamlit config show` to set it up. Then share from - top-right menu. -- ⚙️ Use `server.baseUrlPath` config option to set Streamlit's URL to something - like `http://domain.com/customPath`. - -**Notable bug fixes:** - -- Fixes numerous Windows bugs, including [Issues - #339](https://github.com/streamlit/streamlit/issues/399) and - [#401](https://github.com/streamlit/streamlit/issues/301). - -## Version 0.48.0 - -_Release date: October 12, 2019_ - -**Highlights:** - -- 🔧 Ability to set config options as command line flags or in a local config file. -- ↕️ You can now maximize charts and images! -- ⚡ Streamlit is now much faster when writing data in quick succession to your app. -- ✳️ Ability to blacklist folder globs from "run on save" and `@st.cache` hashing. -- 🎛️ Improved handling of widget state when Python file is modified. -- 🙈 Improved HTML support in `st.write` and `st.markdown`. HTML is still unsafe, though! - -**Notable bug fixes:** - -- Fixes `@st.cache` bug related to having your Python environment on current - working directory. [Issue #242](https://github.com/streamlit/streamlit/issues/242) -- Fixes loading of root url `/` on Windows. [Issue #244](https://github.com/streamlit/streamlit/issues/244) - -## Version 0.47.0 - -_Release date: October 1, 2019_ - -**Highlights:** - -- 🌄 New hello.py showing off 4 glorious Streamlit apps. Try it out! -- 🔄 Streamlit now automatically selects an unused port when 8501 is already in use. -- 🎁 Sidebar support is now out of beta! Just start any command with `st.sidebar.` instead of `st.` -- ⚡ Performance improvements: we added a cache to our websocket layer so we no longer re-send data to the browser when it hasn't changed between runs -- 📈 Our "native" charts `st.line_chart`, `st.area_chart` and `st.bar_chart` now use Altair behind the scenes -- 🔫 Improved widgets: custom st.slider labels; default values in multiselect -- 🕵️‍♀️ The filesystem watcher now ignores hidden folders and virtual environments -- 💅 Plus lots of polish around caching and widget state management - -**Breaking change:** - -- 🛡️ We have temporarily disabled support for sharing static "snapshots" of Streamlit apps. Now that we're no longer in a limited-access beta, we need to make sure sharing is well thought through and abides by laws like the DMCA. But we're working on a solution! - -## Version 0.46.0 - -_Release date: September 19, 2019_ - -**Highlights:** - -- ✨ Magic commands! Use `st.write` without typing `st.write`. See - [https://docs.streamlit.io/en/latest/api.html#magic-commands](https://docs.streamlit.io/en/latest/api.html#magic-commands) -- 🎛️ New `st.multiselect` widget. -- 🐍 Fixed numerous install issues so now you can use `pip install streamlit` - even in Conda! We've therefore deactivated our Conda repo. -- 🐞 Multiple bug fixes and additional polish in preparation for our launch! - -**Breaking change:** - -- 🛡️ HTML tags are now blacklisted in `st.write`/`st.markdown` by default. More - information and a temporary work-around at: - [https://github.com/streamlit/streamlit/issues/152](https://github.com/streamlit/streamlit/issues/152) - -## Version 0.45.0 - -_Release date: August 28, 2019_ - -**Highlights:** - -- 😱 Experimental support for _sidebar_! Let us know if you want to be a beta - tester. -- 🎁 Completely redesigned `st.cache`! Much more performant, has a cleaner API, - support for caching functions called by `@st.cached` functions, - user-friendly error messages, and much more! -- 🖼️ Lightning fast `st.image`, ability to choose between JPEG and PNG - compression, and between RGB and BGR (for OpenCV). -- 💡 Smarter API for `st.slider`, `st.selectbox`, and `st.radio`. -- 🤖 Automatically fixes the Matplotlib backend -- no need to edit .matplotlibrc - -## Version 0.44.0 - -_Release date: July 28, 2019_ - -**Highlights:** - -- ⚡ Lightning-fast reconnect when you do a ctrl-c/rerun on your Streamlit code -- 📣 Useful error messages when the connection fails -- 💎 Fixed multiple bugs and improved polish of our newly-released interactive widgets - -## Version 0.43.0 - -_Release date: July 9, 2019_ - -**Highlights:** - -- ⚡ Support for interactive widgets! 🎈🎉 - -## Version 0.42.0 - -_Release date: July 1, 2019_ - -**Highlights:** - -- 💾 Ability to save Vega-Lite and Altair charts to SVG or PNG -- 🐇 We now cache JS files in your browser for faster loading -- ⛔ Improvements to error-handling inside Streamlit apps - -## Version 0.41.0 - -_Release date: June 24, 2019_ - -**Highlights:** - -- 📈 Greatly improved our support for named datasets in Vega-Lite and Altair -- 🙄 Added ability to ignore certain folders when watching for file changes. See the `server.folderWatchBlacklist` config option. -- ☔ More robust against syntax errors on the user's script and imported modules - -## Version 0.40.0 - -_Release date: June 10, 2019_ - -**Highlights:** - -- Streamlit is more than 10x faster. Just save and watch your analyses update instantly. -- We changed how you run Streamlit apps: - `$ streamlit run your_script.py [script args]` -- Unlike the previous versions of Streamlit, `streamlit run [script] [script args]` creates a server (now you don't need to worry if the proxy is up). To kill the server, all you need to do is hit **Ctrl+c**. - -**Why is this so much faster?** - -Now, Streamlit keeps a single Python session running until you kill the server. This means that Streamlit can re-run your code without kicking off a new process; imported libraries are cached to memory. An added bonus is that `st.cache` now caches to memory instead of to disk. - -**What happens if I run Streamlit the old way?** - -If you run `$ python your_script.py` the script will execute from top to bottom, but won't produce a Streamlit app. - -**What are the limitations of the new architecture?** - -- To switch Streamlit apps, first you have to kill the Streamlit server with **Ctrl-c**. Then, you can use `streamlit run` to generate the next app. -- Streamlit only works when used inside Python files, not interactively from the Python REPL. - -**What else do I need to know?** - -- The strings we print to the command line when **liveSave** is on have been cleaned up. You may need to adjust any RegEx that depends on those. -- A number of config options have been renamed: - - | Old config | New config | - | -------------------------- | --------------------- | - | proxy.isRemote | server.headless | - | proxy.liveSave | server.liveSave | - | proxy.runOnSave | server.runOnSave | - | proxy.watchFileSystem | server.runOnSave | - | proxy.enableCORS | server.enableCORS | - | proxy.port | server.port | - | browser.proxyAddress | browser.serverAddress | - | browser.proxyPort | browser.serverPort | - | client.waitForProxySecs | _n/a_ | - | client.throttleSecs | _n/a_ | - | client.tryToOutliveProxy | _n/a_ | - | client.proxyAddress | _n/a_ | - | client.proxyPort | _n/a_ | - | proxy.autoCloseDelaySecs | _n/a_ | - | proxy.reportExpirationSecs | _n/a_ | - -**What if something breaks?** - -If the new Streamlit isn't working, please let us know by Slack or email. You can downgrade at any time with these commands: - -```bash -pip install --upgrade streamlit==0.37 -``` - -```bash -conda install streamlit=0.37 -``` - -**What's next?** - -Thank you for staying with us on this journey! This version of Streamlit lays the foundation for interactive widgets, a new feature of Streamlit we're really excited to share with you in the next few months. - -## Version 0.36.0 - -_Release date: May 03, 2019_ - -**Highlights** - -- 🚣‍♀️ `st.progress()` now also accepts floats from 0.0–1.0 -- 🤯 Improved rendering of long headers in DataFrames -- 🔐 Shared apps now default to HTTPS - -## Version 0.35.0 - -_Release date: April 26, 2019_ - -**Highlights** - -- 📷 Bokeh support! Check out docs for `st.bokeh_chart` -- ⚡️ Improved the size and load time of saved apps -- ⚾️ Implemented better error-catching throughout the codebase - ---- - -# Pre-release features - -Source: https://docs.streamlit.io/develop/quick-reference/prerelease - - -At Streamlit, we like to move quick while keeping things stable. In our latest effort to move even faster without sacrificing stability, we're offering our bold and fearless users two ways to try out Streamlit's bleeding-edge features: - -1. [Experimental features](#experimental-features) -2. [Nightly releases](#nightly-releases) - -## Experimental Features - -Less stable Streamlit features have one naming convention: `st.experimental_`. This distinction is a prefix we attach to our command names to make sure their status is clear to everyone. - -Here's a quick rundown of what you get from each naming convention: - -- **st**: this is where our core features like `st.write` and `st.dataframe` live. If we ever make backward-incompatible changes to these, they will take place gradually and with months of announcements and warnings. -- **experimental**: this is where we'll put all new features that may or may not ever make it into Streamlit core. This gives you a chance to try the next big thing we're cooking up weeks or months before we're ready to stabilize its API. We don't know whether these features have a future, but we want you to have access to everything we're trying, and work with us to figure them out. - -Features with the `experimental_` naming convention are things that we're still working on or trying -to understand. If these features are successful, at some point they'll become part of Streamlit -core. If unsuccessful, these features are removed without much notice. While in experimental, a feature's API and behaviors may not be stable, and it's possible they could change in ways that aren't backward-compatible. - - - -Experimental features and their APIs may change or be removed at any time. - - - -### The lifecycle of an experimental feature - -1. A feature is added with the `experimental_` prefix. -2. The feature is potentially tweaked over time, with possible API/behavior breakages. -3. If successful, we promote the feature to Streamlit core and remove it from `experimental_`: - - a\. The feature's API stabilizes and the feature is _cloned_ without the `experimental_` prefix, so it exists as both `st` and `experimental_`. At this point, users will see a warning when using the version of the feature with the `experimental_` prefix -- but the feature will still work. - - b\. At some point, the code of the `experimental_`-prefixed feature is _removed_, but there will still be a stub of the function prefixed with `experimental_` that shows an error with appropriate instructions. - - c\. Finally, at a later date the `experimental_` version is removed. -4. If unsuccessful, the feature is removed without much notice and we leave a stub in `experimental_` that shows an error with instructions. - -## Nightly releases - -In addition to experimental features, we offer another way to try out Streamlit's newest features: nightly releases. - -At the end of each day (at night 🌛), our bots run automated tests against the latest Streamlit code and, if everything looks good, it publishes them as the `streamlit-nightly` package. This means the nightly build includes all our latest features, bug fixes, and other enhancements on the same day they land on our codebase. - -**How does this differ from official releases?** - -Official Streamlit releases go not only through both automated tests but also rigorous manual testing, while nightly releases only have automated tests. It's important to keep in mind that new features introduced in nightly releases often lack polish. In our official releases, we always make double-sure all new features are ready for prime time. - -**How do I use the nightly release?** - -All you need to do is install the `streamlit-nightly` package: - -```bash -pip uninstall streamlit -pip install streamlit-nightly --upgrade -``` - - - -You should never have both `streamlit` and `streamlit-nightly` installed in the same environment! - - - -**Why should I use the nightly release?** - -Because you can't wait for official releases, and you want to help us find bugs early! - -**Why shouldn't I use the nightly release?** - -While our automated tests have high coverage, there's still a significant likelihood that there will be some bugs in the nightly code. - -**Can I choose which nightly release I want to install?** - -If you'd like to use a specific version, you can find the version number in our [Release history](https://pypi.org/project/streamlit-nightly/#history). Specify the desired version using `pip` as usual: `pip install streamlit-nightly==x.yy.zz-123456`. - -**Can I compare changes between releases?** - -If you'd like to review the changes for a nightly release, you can use the [comparison tool on GitHub](https://github.com/streamlit/streamlit/compare/0.57.3...0.57.4.dev20200412). - ---- - -# Deploy - -Source: https://docs.streamlit.io/deploy - - -Get all the information you need to deploy your app and share it with your users. - - -Understand the basics of app deployment. -Deploy your app on our free platform and join a community of developers who share their apps around the world. This is a great place for your non-commerical, personal, and educational apps. -Deploy your app in Snowflake for a secure, enterprise-grade environment. This is a great place for your business apps. -Learn how to deploy your app on a variety of platforms with our convenient collection of tutorials. - - ---- - -# Deployment concepts - -Source: https://docs.streamlit.io/deploy/concepts - - -Learn the fundamental concepts of app deployment. There are three main processes involved in deploying apps. - -- Install Python, Streamlit, and other dependencies in your deployment environment. -- Securely handle your secrets and private information. -- Remote start your app (`streamlit run`). - -If you're using Streamlit Community Cloud, we'll do most of the work for you! - - -Understand the basics of configuring your deployment environment. -Understand the basics of secret management. - - ---- - -# Managing dependencies when deploying your app - -Source: https://docs.streamlit.io/deploy/concepts/dependencies - - -Before you began developing your app, you set up and configured your development environment by installing Python and Streamlit. When you deploy your app, you need to set up and configure your deployment environment in the same way. When you deploy your app to a cloud service, your app's [Python server](/develop/concepts/architecture/architecture#python-backend-server) will be running on a remote machine. This remote machine will not have access all the files and programs on your personal computer. - -All Streamlit apps have at least two dependencies: Python and Streamlit. Your app may have additional dependencies in the form of Python packages or software that must be installed to properly execute your script. If you are using a service like Streamlit Community Cloud which is designed for Streamlit apps, we'll take care of Python and Streamlit for you! - -## Install Python and other software - -If you are using Streamlit Community Cloud, Python is already installed. You can just pick the version in the deployment dialog. If you need to install Python yourself or you have other non-Python software to install, follow your platform's instructions to install additional software. You will commonly use a package management tool to do this. -For example, Streamlit Community Cloud uses Advanced Package Tool (`apt`) for Debian-based Linux systems. For more information about installing non-Python depencies on Streamlit Community Cloud, see [`apt-get` dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#apt-get-dependencies). - -## Install Python packages - -Once you have Python installed in your deployment environment, you'll need to install all the necessary Python packages, including Streamlit! With each `import` of an installed package, you add a Python dependency to your script. You need to install those dependencies in your deployment environment through a Python package manager. - -If you are using Streamlit Community Cloud, you'll have the latest version of Streamlit and all of its dependencies installed by default. So, if you're making a simple app and don't need additional dependencies, you won't have to do anything at all! - -### `pip` and `requirements.txt` - -Since `pip` comes by default with Python, the most common way to configure your Python environment is with a `requirements.txt` file. Each line of a `requirements.txt` file is a package to `pip install`. You should _not_ include built-in Python libraries like `math`, `random`, or `distutils` in your `requirements.txt` file. These are a part of Python and aren't installed separately. - - - -Since dependencies may rely on a specific version of Python, always be aware of the Python version used in your development environment, and select the same version for your deployment environment. - - - -If you have a script like the following, you would only need to install Streamlit. No extra dependencies would be needed since `pandas` and `numpy` are installed as direct dependencies of `streamlit`. Similarly, `math` and `random` are built into Python. - -```python -import streamlit as st -import pandas as pd -import numpy as np -import math -import random - -st.write('Hi!') -``` - -However, it's a best practice accurately record packages you use, so the recommended `requirements.txt` file would be: - -```none -streamlit -pandas -numpy -``` - -If you needed to specify certain versions, another valid example would be: - -```none -streamlit==1.24.1 -pandas>2.0 -numpy - ---- - -# Managing secrets when deploying your app - -Source: https://docs.streamlit.io/deploy/concepts/secrets - - -If you are connecting to data sources or external services, you will likely be handling secret information like credentials or keys. Secret information should be stored and transmitted in a secure manner. When you deploy your app, ensure that you understand your platform's features and mechanisms for handling secrets so you can follow best practice. - -Avoid saving secrets directly in your code and keep `.gitignore` updated to prevent accidentally committing a local secret to your repository. For helpful reminders, see [Security reminders](/develop/concepts/connections/security-reminders). - -If you are using Streamlit Community Cloud, [Secrets management](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management) allows you save environment variables and store secrets outside of your code. If you are using another platform designed for Streamlit, check if they have a built-in mechanism for working with secrets. In some cases, they may even support `st.secrets` or securely uploading your `secrets.toml` file. - -For information about using `st.connection` with environment variables, see [Global secrets, managing multiple apps and multiple data stores](/develop/concepts/connections/connecting-to-data#global-secrets-managing-multiple-apps-and-multiple-data-stores). - ---- - -# Welcome to Streamlit Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud - - -With Streamlit Community Cloud, you can create, deploy, and manage your Streamlit apps all for free. Share your apps with the world and build a customized profile page to display your work. Your Community Cloud account connects directly to your GitHub repositories (public or private). Most apps will launch in only a few minutes. Community Cloud handles all of the containerization, so deploying is easy. Bring your own code, or start from one of our popular templates. Rapidly prototype, explore, and update apps by simply changing your code in GitHub. Most changes appear immediately! - -Want to avoid the work of setting up a local development environment? Community Cloud can help you quickly configure a codespace to develop in the cloud. Start coding or editing a Streamlit app with just a few clicks. See [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app). - -Go to our [Community Cloud quickstart](/deploy/streamlit-community-cloud/get-started/quickstart) to speed-run through creating your account, deploying an example app, and editing it using GitHub Codespaces. If you haven't built your first Streamlit app yet, see [Get started with Streamlit](/get-started). - - -Learn about Streamlit Community Cloud accounts and how to create one. -A step-by-step guide on how to get your app deployed. -Access logs, reboot apps, set favorites, and more. Jump into a GitHub codespace to edit your app in the cloud. -Share or embed your app. -Update your email, manage connections, or delete your account. - - ---- - -# Get started with Streamlit Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started - - -Welcome to Streamlit Community Cloud, where you can share your Streamlit apps with the world! Whether you've already created your first Streamlit app or you're just getting started, you're in the right place. - -First things first, you need to create your Streamlit Community Cloud account to start deploying apps. - - - - - - -If you're looking for help to build your first Streamlit app, read our [Get started](/get-started) docs for the Streamlit library. If you want to fork an app and start with an example, check out our App gallery. Either way, it only takes a few minutes to create your first app. - -If you're looking for more detailed instructions than the quickstart, try the following: - - -See all the options and get complete explanations as you create your Streamlit Community Cloud account. -After your create your Community Cloud account, connect GitHub for source control. -Take a quick tour of your Community Cloud workspace. See where all the magic happens. -Use a template to get your own app up and running in minutes. -Start with a bang! Fork a public app and jump right into the code. - - ---- - -# Quickstart - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/quickstart - - -This is a concise set of steps to create your Streamlit Community Cloud account, deploy a sample app, and start editing it with GitHub Codespaces. For other options and complete explanations, start with [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account). - -You will sign in to your GitHub account during this process. Community Cloud will use the email from your GitHub account to create your Community Cloud account. For other sign-in options, see [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account). - -## Prerequisites - -- You must have a GitHub account. - -## Sign up for Streamlit Community Cloud - -1. Go to share.streamlit.io. -1. Click "**Continue to sign-in**." -1. Click "**Continue with GitHub**." -1. Enter your GitHub credentials and follow GitHub's authentication prompts. -1. Fill in your account information, and click "**I accept**" at the bottom. - -## Add access to your public repositories - -1. In the upper-left corner, click "**Workspaces {{ verticalAlign: "-.25em", color: "#ff8700" }} className={{ class: "material-icons-sharp" }}>warning - ---- - -# Create your account - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/create-your-account - - -Before you can start deploying apps for the world to see, you need to sign up for your Streamlit Community Cloud account. - -Each Community Cloud account is associated with an email. Two accounts can't have the same email. When sharing a private app, you will assign viewing privileges by email. Additionally, two accounts can't have the same source control (GitHub account). If you try to create a second Community Cloud account with the same source control, Community Cloud will merge the accounts. - -## Sign up - -Community Cloud allows you to sign in using one of the three following methods: - -- Emailed, one-use codes -- Google -- GitHub - - - Even when you sign in through GitHub, the authentication flow returns your email address to Community Cloud. Changing the email on your GitHub account can affect your Community Cloud account if you sign in through GitHub. - - -1. Go to share.streamlit.io. -1. Click "**Continue to sign-in**." -1. Continue with one of the three options listed below. - - ### Option 1: Sign in using emailed codes - - 1. In the "Email" field, enter your email address. - 1. Click "**Continue**." (If prompted, verify you are human.) - 1. Go to your email inbox, and copy your one-time, six-digit code. The code is valid for ten minutes. - 1. Return to the authentication page, and enter your code. (If prompted, verify you are human.) - - ### Option 2: Sign in using Google - - 1. Click "**Continue with Google**." - 1. Enter your Google credentials, and follow Google's authentication prompts. - - ### Option 3: Sign in using GitHub - - 1. Click "**Continue with GitHub**." - 1. Enter your GitHub credentials, and follow GitHub's authentication prompts. - - This adds the "Streamlit Community Cloud" OAuth application to your GitHub account. This application is only used to pass your email when you sign in to Community Cloud. On the next page, you'll perform additional steps to allow Community Cloud to access your repositories. For more information about using and reviewing the OAuth applications on your account, see [Using OAuth apps](https://docs.github.com/en/apps/oauth-apps/using-oauth-apps) in GitHub's docs. - -1. Fill in your information, and click "**Continue**" at the bottom. - - The "Primary email" field is prefilled with the email you used to sign in. If you change this email in the account setup form, it will only impact marketing emails; it will not reflect on your new account. To change the email associated with your account after it's created, see [Update your email address](/deploy/streamlit-community-cloud/manage-your-account/update-your-email). - -## Finish up - -Congratulations on creating your Streamlit Community Cloud account! A warning icon ({{ verticalAlign: "-.25em", color: "#ff8700" }} className={{ class: "material-icons-sharp" }}>warning - ---- - -# Connect your GitHub account - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/connect-your-github-account - - -Connecting GitHub to your Streamlit Community Cloud account allows you to deploy apps directly from the files you store in your repositories. It also lets the system check for updates to those files and automatically update your apps. When you first connect your GitHub account to your Community Cloud account, you'll be able to deploy apps from your public repositories to Community Cloud. If you want to deploy from private repositories, you can give Community Cloud additional permissions to do so. For more information about these permissions, see [GitHub OAuth scope](/deploy/streamlit-community-cloud/status#github-oauth-scope). - - - In order to deploy an app, you must have **admin** permissions to its repository. If you don't have admin access, contact the repository's owner or fork the repository to create your own copy. For more help, see our community forum. - - -If you are a member of a GitHub organization, that organization is displayed at the bottom of each GitHub OAuth prompt. In this case, we recommend reading about [Organization access](#organization-access) at the end of this page before performing the steps to connect your GitHub account. You must be an organization's owner in GitHub to grant access to that organization. - -## Prerequisites - -- You must have a Community Cloud account. See [Create your account](/deploy/streamlit-community-cloud/get-started/create-your-account). -- You must have a GitHub account. - -## Add access to public repositories - -1. In the upper-left corner, click "**Workspaces {{ verticalAlign: "-.25em", color: "#ff8700" }} className={{ class: "material-icons-sharp" }}>warning - ---- - -# Explore your workspace - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/explore-your-workspace - - -If you just [created your account](/deploy/streamlit-community-cloud/get-started/create-your-account) and [connected your GitHub account](/deploy/streamlit-community-cloud/get-started/connect-your-github-account), congrats! You are now signed in and ready to go. If you are joining someone else's workspace you may already see some apps. - -## Workspaces - -Each GitHub account and organization is associated with a workspace in Community Cloud. When you sign in to Community Cloud for the first time, you will land in your personal workspace associated with your GitHub user account. The upper-left corner of Community Cloud shows your current workspace. - -![A new, empty workspace in Streamlit Community Cloud. The workspace owner is displayed in the upper-left corner.](/images/streamlit-community-cloud/workspace-empty-SM.png) - -### Switching workspaces - -To switch between workspaces, click the workspace name in the upper-left corner and select a new workspace. - -Other workspaces are available to you as follows: - -- When you have write permissions to a repository and the repository owner has joined Community Cloud, you can select the associated workspace. An owner can be a GitHub user or organization. -- If someone has shared an app with you through Community Cloud, you will see the app's associated workspace. This is view-only access. - -![This workspace is for the user `sammy-streamlit`, who has access to their personal workspace and another workspace for the organization `we-love-streamlit`.](/images/streamlit-community-cloud/workspace-empty-switch.png) - -### Invite other developers to your workspace - -Inviting other developers is simple: Just give them write access to your GitHub repository so that you can code together. When they sign in to share.streamlit.io, they'll have access to your workspace. - -Streamlit Community Cloud inherits developer permissions from GitHub. When others sign in to Community Cloud, they will automatically see the workspaces they share with you. From there you can all deploy, manage, and share apps together. - - - -When a user is added to a repository on GitHub, it will take at most 15 minutes before they can deploy or manage the app on Community Cloud. If a user is removed from a repository on GitHub, it will take at most 15 minutes before their permission to manage the app from that repository is revoked. - - - -And remember, whenever anyone on the team updates the code on GitHub, the app will automatically update for you! - -## My apps - -The "**My apps**" section of your workspace is your base of operations to deploy and manage your apps. When you deploy an app, it is added to this section of your workspace. - -### Deploying apps - -If you already have an app saved to a GitHub repo, you can deploy it directly. Otherwise, Community Cloud provides templates you can use. When you deploy from a template, Community Cloud will fork a project into your GitHub account and deploy from the new fork. This is a convenient way to get started if you haven't already created a Streamlit app. - -To get started, just click "**Create app**" in the upper-right corner. To learn more, see [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app) and [Deploy from a template](/deploy/streamlit-community-cloud/get-started/deploy-from-a-template). - -## My profile - -The "**My profile**" section of your workspace lets you customize a personal portfolio of Streamlit apps to share with the world. Curate and feature your Streamlit apps to show off your work. - -## Explore - -For inspiration, check out the "**Explore**" section. This is a gallery of Streamlit apps created by the Streamlit community. Check out popular and trending apps, or search for apps in an area that interests you. - ---- - -# Deploy an app from a template - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/deploy-from-a-template - - -Streamlit Community Cloud makes it easy to get started with several convenient templates. Just pick a template, and Community Cloud will fork it to your account and deploy it. Any edits you push to your new fork will immediately show up in your deployed app. Additionally, if you don't want to use a local development environment, Community Cloud makes it easy to create a GitHub codespace that's fully configured for Streamlit app development. - -## Access the template picker - -There are two ways to begin deploying a template: the "**Create app**" button and the template gallery at the bottom of your workspace. - -- If you click the "**Create app**" button, Community Cloud will ask you "Do you already have an app?" Select "**Nope, create one from a template**." -- If you scroll to the bottom of your workspace in the "**My apps**" section, you can see the most popular templates. Click on one directly, or select "**View all templates**." - -The template picker shows a list of available templates on the left. A preview for the current, selected template shows on the right. - -!["Deploy from a template" page on Community Cloud](/images/streamlit-community-cloud/deploy-template-picker.png) - -## Select a template - -1. From the list of templates on the left, select "**GDP dashboard**." -1. Optional: For "Name of new GitHub repository," enter a name for your new, forked repository. - - When you deploy a template, Community Cloud forks the template repository into your GitHub account. Community Cloud chooses a default name for this repository based on the selected template. If you have previously deployed the same template with its default name, Community Cloud will append an auto-incrementing number to the name. - - - Even if you have another user's or organization's workspace selected, Community Cloud will always deploy a template app from your personal workspace. That is, Community Cloud will always fork a template into your GitHub user account. If you want to deploy a template app from an organization, manually fork the template in GitHub, and deploy it from your fork in the associated workspace. - - -1. Optional: In the "App URL" field, choose a subdomain for your new app. - - Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings). - -1. Optional: To edit the template in a GitHub codespace immediately, select the option to "**Open GitHub Codespaces...**" - - You can create a codespace for your app at any time. To learn how to create a codespace after you've deployed an app, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app). - -1. Optional: To change the version of Python, at the bottom of the screen, click "**Advanced settings**," select a Python version, and then click "**Save**." - - - After an app is deployed, you can't change the version of Python without deleting and redeploying the app. - - -1. At the bottom, click "**Deploy**." - -## View your app - -- If you didn't select the option to open GitHub Codespaces, you are redirected to your new app. - - ![GDP dashboard template app](/images/streamlit-community-cloud/deploy-template-GDP.png) - -- If you selected the option to open GitHub Codespaces, you are redirected to your new codespace, which can take several minutes to be fully initialized. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file. - - ![GDP dashboard template app in a codespace](/images/streamlit-community-cloud/deploy-template-GDP-codespace.png) - - - The app displayed in your codespace is not the same instance you deployed on Community Cloud. Your codespace is a self-contained development environment. When you make edits inside a codespace, those edits don't leave the codespace until you commit them to your repository. When you commit your changes to your repository, Community Cloud detects the changes and updates your deployed app. To learn more, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app). - - ---- - -# Fork and edit a public app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/fork-and-edit-a-public-app - - -Community Cloud is all about learning, sharing, and exploring the world of Streamlit. For apps with public repositories, you can quickly fork copies to your GitHub account, deploy your own version, and jump into a codespace on GitHub to start editing and exploring Streamlit code. - -1. From a forkable app, in the upper-right corner, click "**Fork**." - - ![Click Fork in the upper-right corner of a public app](/images/streamlit-community-cloud/fork-public-hello.png) - -1. Optional: In the "App URL" field, choose a custom subdomain for your app. - - Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings). - -1. Click "**Fork!**" - - The repository will be forked to your GitHub account. If you have already forked the repository, Community Cloud will use the existing fork. If your existing fork already has an associated codespace, the codespace will be reused. - - - Do not use this method in the following situations: - - You have an existing repository that matches the fork name (but isn't a fork of this app). - - You have an existing fork of this app, but you've changed the name of the repository. - - If you have an existing fork of this app and kept the original repository name, Community Cloud will use your existing fork. If you've previously deployed the app and opened a codespace, Community Cloud will open your existing codespace. - - - ![Click Fork to confirm and deploy your app](/images/streamlit-community-cloud/fork-public-hello-deploy.png) - -1. Wait for GitHub to set up your codespace. - - It can take several minutes to fully initialize your codespace. After the Visual Studio Code editor appears in your codespace, it can take several minutes to install Python and start the Streamlit server. When complete, a split screen view displays a code editor on the left and a running app on the right. The code editor opens two tabs by default: the repository's readme file and the app's entrypoint file. - - ![Click Fork to confirm and deploy your app](/images/streamlit-community-cloud/fork-public-hello-codespace.png) - - - The app displayed in your codespace is not the same instance you deployed on Community Cloud. Your codespace is a self-contained development environment. When you make edits inside a codespace, those edits don't leave the codespace until you commit them to your repository. When you commit your changes to your repository, Community Cloud detects the changes and updates your deployed app. To learn more, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app). - - -1. Edit your newly forked app as desired. For more instructions on working with GitHub Codespaces, see [Edit your app](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app). - ---- - -# Streamlit trust and security - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/get-started/trust-and-security - - -Streamlit is a framework that turns Python scripts into interactive apps, giving data scientists the ability to quickly create data and model-based apps for the entire company. - -A simple Streamlit app is: - -```python -import streamlit as st -number = st.slider("Pick a number: ", min_value=1, max_value=10) -st.text("Your number is " + str(number)) -``` - -When you `streamlit run my_app.py`, you start a web server that runs the interactive application on your local computer at `http://localhost:8501`. This is great for local development. When you want to share with your colleagues, Streamlit Community Cloud enables you to deploy and run these applications in the cloud. Streamlit Community Cloud handles the details of containerization and provides you an interface for easily managing your deployed apps. - -This document provides an overview of the security safeguards we've implemented to protect you and your data. Security, however, is a shared responsibility and you are ultimately responsible for making appropriate use of Streamlit and the Streamlit Community Cloud, including implementation of appropriate user-configurable security safeguards and best practices. - -## Product security - -### Authentication - -You must authenticate through GitHub to deploy or administer an app. Authentication through Google or single-use emailed links are required to view a private app when you don't have push or admin permissions on the associated GitHub repository. The single-use emailed links are valid for 15 minutes once requested. - -### Permissions - -Streamlit Community Cloud inherits the permissions you have assigned in GitHub. Users with write access to a GitHub repository for a given app will be able to make changes in the Streamlit administrative console. However, only users with _admin access_ to a repository are able to **deploy and delete apps**. - -## Network and application security - -### Data hosting - -Our physical infrastructure is hosted and managed within secure data centers maintained by infrastructure-as-a-service cloud providers. Streamlit leverages many of these platforms' built-in security, privacy, and redundancy features. Our cloud providers continually monitor their data centers for risk and undergo assessments to ensure compliance with industry standards. - -### Data deletion - -Community Cloud users have the option to delete any apps they’ve deployed as well as their entire account. - -When a user deletes their application from the admin console, we delete their source code, including any files copied from their GitHub repository or created within our system from the running app. However, we keep a record representing the application in our database. This record contains the coordinates of the application: the GitHub organization or user, the GitHub repository, the branch, and the path of the main module file. - -When a user deletes their account, we perform a hard deletion of their data and a hard deletion of all the apps that belong to the GitHub identity associated with their account. In this case, we do not maintain the records of application coordinates described above. When an account is deleted, we also delete any HubSpot contact associated with the Community Cloud account. - -### Virtual private cloud - -All of our servers are within a virtual private cloud (VPC) with firewalls and network access control lists (ACLs) to allow external access to a select few API endpoints; all other internal services are only accessible within the VPC. - -### Encryption - -Streamlit apps are served entirely over HTTPS. We use only strong cipher suites and HTTP Strict Transport Security (HSTS) to ensure browsers interact with Streamlit apps over HTTPS. - -All data sent to or from Streamlit over the public internet is encrypted in transit using 256-bit encryption. Our API and application endpoints use Transport Layer Security (TLS) 1.2 (or better). We also encrypt data at rest on disk using AES-256. - -### Permissions and authentication - -Access to Community Cloud user account data is limited to authorized personnel. We run a zero-trust corporate network, utilize single sign-on and multi-factor authentication (MFA), and enforce strong password policies to ensure access to cloud-related services is protected. - -### Incident response - -Our internal protocol for handling security events includes detection, analysis, response, escalation, and mitigation. Security advisories are made available at [https://streamlit.io/advisories](https://streamlit.io/advisories). - -### Penetration testing - -Streamlit uses third-party security tools to scan for vulnerabilities on a regular basis. Our security teams conduct periodic, intensive penetration tests on the Streamlit platform. Our product development team responds to any identified issues or potential vulnerabilities to ensure the quality, security, and availability of Streamlit applications. - -### Vulnerability management - -We keep our systems up-to-date with the latest security patches and continuously monitor for new vulnerabilities. This includes automated scanning of our code repositories for vulnerable dependencies. - -If you discover a vulnerability in one of our products or websites, please report the issue to [HackerOne](https://hackerone.com/snowflake?type=team). - ---- - -# Prep and deploy your app on Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app - - -Streamlit Community Cloud lets you deploy your apps in just one click, and most apps will be deployed in only a few minutes. If you don't have an app ready to deploy, you can fork or clone one from our App galleryyou can find apps for machine learning, data visualization, data exploration, A/B testing, and more. You can also [Deploy an app from a template](/deploy/streamlit-community-cloud/get-started/deploy-from-a-template). After you've deployed your app, check out how you can [Edit your app with GitHub Codespaces](/deploy/streamlit-community-cloud/manage-your-app/edit-your-app#edit-your-app-with-github-codespaces). - - - -If you want to deploy your app on a different cloud service, see our [Deployment tutorials](/deploy/tutorials). - - - -## Summary - -The pages that follow explain how to organize your app and provide complete information for Community Cloud to run it correctly. - -When your app has everything it needs, deploying is easy. Just go to your workspace and click "**Create app**" in the upper-right corner. Follow the prompts to fill in your app's information, and then click "**Deploy**." - -![Deploy a new app from your workspace](/images/streamlit-community-cloud/deploy-empty-new-app.png) - -## Ready, set, go! - - -Learn how Community Cloud initializes your app and interprets paths. Learn where to put your configuration files. -Learn how to install dependencies and other Python libraries into your deployment environment. -Learn about the interface Community Cloud provides to securely upload your secrets.toml data. -Put it all together to deploy your app for the whole world to see. - - ---- - -# File organization for your Community Cloud app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/file-organization - - -Streamlit Community Cloud copies all the files in your repository and executes `streamlit run` from its root directory. Because Community Cloud is creating a new Python environment to run your app, you need to include a declaration of any [App dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies) in addition to any [Configuration](/develop/concepts/configuration) options. - -You can have multiple apps in your repository, and their entrypoint files can be anywhere in your repository. However, you can only have one configuration file. This page explains how to correctly organize your app, configuration, and dependency files. The following examples assume you are using `requirements.txt` to declare your dependencies because it is the most common. As explained on the next page, Community Cloud supports other formats for configuring your Python environment. - -## Basic example - -In the following example, the entrypoint file (`your_app.py`) is in the root of the project directory alongside a `requirements.txt` file to declare the app's dependencies. - -``` -your_repository/ -├── requirements.txt -└── your_app.py -``` - -If you are including custom configuration, your config file must be located at `.streamlit/config.toml` within your repository. - -``` -your_repository/ -├── .streamlit/ -│ └── config.toml -├── requirements.txt -└── your_app.py -``` - -Additionally, any files that need to be locally available to your app should be included in your repository. - - - -If you have really big or binary data that you change frequently, and git is running slowly, you might want to check out [Git Large File Store (LFS)](https://git-lfs.github.com/) as a better way to store large files in GitHub. You don't need to make any changes to your app to start using it. If your GitHub repository uses LFS, it will _just work_ with Streamlit Community Cloud. - - - -## Use an entrypoint file in a subdirectory - -When your entrypoint file is in a subdirectory, the configuration file must stay at the root. However, your dependency file may be either at the root or next to your entrypoint file. - -Your dependency file can be at the root of your repository while your entrypoint file is in a subdirectory. - -``` -your_repository/ -├── .streamlit/ -│ └── config.toml -├── requirements.txt -└── subdirectory - └── your_app.py -``` - -Alternatively, your dependency file can be in the same subdirectory as your entrypoint file. - -``` -your_repository/ -├── .streamlit/ -│ └── config.toml -└── subdirectory - ├── requirements.txt - └── your_app.py -``` - -Although most Streamlit commands interpret paths relative to the entrypoint file, some commands interpret paths relative to the working directory. On Community Cloud, the working directory is always the root of your repository. Therefore, when developing and testing your app locally, execute `streamlit run` from the root of your repository. This ensures that paths are interpreted consistently between your local environment and Community Cloud. - -In the previous example, this would look something like this: - -```bash -cd your_repository -streamlit run subdirectory/your_app.py -``` - - - Remember to always use forward-slash path separators in your paths. Community Cloud can't work with backslash-separated paths. - - -## Multiple apps in one repository - -When you have multiple apps in one repository, they share the same configuration file (`.streamlit/config.toml`) at the root of your repository. A dependency file may be shared or configured separately for these multiple apps. To define separate dependency files for your apps, place each entrypoint file in its own subdirectory along with its own dependency file. To learn more about how Community Cloud prioritizes and parses dependency files, see [App dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies). - ---- - -# App dependencies for your Community Cloud app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies - - -The main reason that apps fail to build properly is because Streamlit Community Cloud can't find your dependencies! There are two kinds of dependencies your app might have: Python dependencies and external dependencies. Python dependencies are other Python packages (just like Streamlit!) that you `import` into your script. External dependencies are less common, but they include any other software your script needs to function properly. Because Community Cloud runs on Linux, these will be Linux dependencies installed with `apt-get` outside the Python environment. - -For your dependencies to be installed correctly, make sure you: - -1. Add a [requirements file](#add-python-dependencies) for Python dependencies. -2. Optional: To manage any external dependencies, add a `packages.txt` file. - - - -Python requirements files should be placed either in the root of your repository or in the same -directory as your app's entrypoint file. - - - -## Add Python dependencies - -With each `import` statement in your script, you are bringing in a Python dependency. You need to tell Community Cloud how to install those dependencies through a Python package manager. We recommend using a `requirements.txt` file, which is based on `pip`. - -You should _not_ include built-in Python libraries like `math`, `random`, or `distutils` in your `requirements.txt` file. These are a part of Python and aren't installed separately. Also, Community Cloud has `streamlit` installed by default. You don't strictly need to include `streamlit` unless you want to pin or restrict the version. If you deploy an app without a `requirements.txt` file, your app will run in an environment with just `streamlit` (and its dependencies) installed. - - - -The version of Python you use is important! Built-in libraries change between versions of Python and other libraries may have specific version requirements, too. Whenever Streamlit supports a new version of Python, Community Cloud quickly follows to default to that new version of Python. Always develop your app in the same version of Python you will use to deploy it. For more information about setting the version of Python when you deploy your app, see [Optional: Configure secrets and Python version](/deploy/streamlit-community-cloud/deploy-your-app/deploy#optional-configure-secrets-and-python-version). - - - -If you have a script like the following, no extra dependencies would be needed since `pandas` and `numpy` are installed as direct dependencies of `streamlit`. Similarly, `math` and `random` are built into Python. - -```python -import streamlit as st -import pandas as pd -import numpy as np -import math -import random - -st.write("Hi!") -``` - -However, a valid `requirements.txt` file would be: - -```none -streamlit -pandas -numpy -``` - -Alternatively, if you needed to specify certain versions, another valid example would be: - -```none -streamlit==1.24.1 -pandas>2.0 -numpy - ---- - -# Secrets management for your Community Cloud app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management - - -## Introduction - -If you are [connecting to data sources](/develop/tutorials/databases), you will likely need to handle credentials or secrets. Storing unencrypted secrets in a git repository is a bad practice. If your application needs access to sensitive credentials, the recommended solution is to store those credentials in a file that is not committed to the repository and to pass them as environment variables. - -## How to use secrets management - -Community Cloud lets you save your secrets within your app's settings. When developing locally, you can use `st.secrets` in your code to read secrets from a `.streamlit/secrets.toml` file. However, this `secrets.toml` file should never be committed to your repository. Instead, when you deploy your app, you can paste the contents of your `secrets.toml` file into the "**Advanced settings**" dialog. You can update your secrets at any time through your app's settings in your workspace. - -### Prerequisites - -- You should understand how to use `st.secrets` and `secrets.toml`. See [Secrets management](/develop/concepts/connections/secrets-management). - -### Advanced settings - -While deploying your app, you can access "**Advanced settings**" to set your secrets. After your app is deployed, you can view or update your secrets through the app's settings. The deployment workflow is fully described on the next page, but the "**Advanced settings**" dialog looks like this: - -
{{ maxWidth: '70%', margin: 'auto' }}> -Advanced settings for deploying your app -
- ---- - -# Deploy your app on Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/deploy - - -After you've [organized your files](/deploy/streamlit-community-cloud/deploy-your-app/file-organization) and [added your dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies) as described on the previous pages, you're ready to deploy your app to Community Cloud! - -## Select your repository and entrypoint file - -1. From your workspace at share.streamlit.io, in the upper-right corner, click "**Create app**." - - ![Deploy a new app from your workspace](/images/streamlit-community-cloud/deploy-empty-new-app.png) - -1. When asked "Do you already have an app?" click "**Yup, I have an app**." -1. Fill in your repository, branch, and file path. Alternatively, to paste a link directly to `your_app.py` on GitHub, click "**Paste GitHub URL**." -1. Optional: In the "App URL" field, choose a subdomain for your new app. - - Every Community Cloud app is deployed to a subdomain on `streamlit.app`, but you can change your app's subdomain at any time. For more information, see [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings). In the following example, Community Cloud will deploy an app to `https://red-balloon.streamlit.app/`. - - ![Fill in your app's information to deploy your app](/images/streamlit-community-cloud/deploy-an-app.png) - - Although Community Cloud attempts to suggest available repositories and files, these suggestions are not always complete. If the desired information is not listed for any field, enter it manually. - -## Optional: Configure secrets and Python version - - - -Streamlit Community Cloud supports all released [versions of Python that are still receiving security updates](https://devguide.python.org/versions/). Streamlit Community Cloud defaults to version 3.12. You can select a version of your choice from the "Python version" dropdown in the "Advanced settings" modal. If an app is running a version of Python that becomes unsupported, it will be forcibly upgraded to the oldest supported version of Python and may break. - - - -1. Click "**Advanced settings**." -1. Select your desired version of Python. -1. To define environment variables and secrets, in the "Secrets" field, paste the contents of your `secrets.toml` file. - - For more information, see [Community Cloud secrets management](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management). - -1. Click "**Save**." - -
{{ maxWidth: '70%', margin: 'auto' }}> -Advanced settings for deploying your app -
- ---- - -# Manage your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app - - -You can manage your deployed app from your workspace at share.streamlit.io or directly from `.streamlit.app`. You can view, deploy, delete, reboot, or favorite an app. - -## Manage your app from your workspace - -Streamlit Community Cloud is organized into workspaces, which automatically group your apps according to their repository's owner in GitHub. Your workspace is indicated in the upper-left corner. For more information, see [Switching workspaces](/deploy/streamlit-community-cloud/get-started/explore-your-workspace#switching-workspaces). - -To deploy or manage any app, always switch to the workspace matching the repository's owner first. - -### Sort your apps - -If you have many apps in your workspace, you can pin apps to the top by marking them as favorite ({{ verticalAlign: "-.25em", color: "#faca2b" }} className={{ class: "material-icons-sharp" }}>star). For more information, see [Favorite your app](/deploy/streamlit-community-cloud/manage-your-app/favorite-your-app). - -### App overflow menus - -Each app has a menu accessible from the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# App analytics - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/app-analytics - - -Streamlit Community Cloud allows you to see the viewership of each of your apps. Specifically, you can see: - -- The total viewers count of your app (counted from April 2022). -- The most recent unique viewers (capped at the last 20 viewers). -- A relative timestamp of each unique viewer's last visit. - -![App analytics on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-analytics-viewers.png) - -## Access your app analytics - -You can get to your app's analytics: - -- [From your workspace](#access-app-analytics-from-your-workspace). -- [From your Cloud logs](#access-app-analytics-from-your-cloud-logs). - -### Access app analytics from your workspace - -From your workspace at share.streamlit.io, click the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# App settings - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/app-settings - - -This page is about your app settings on Streamlit Community Cloud. From your app settings you can [view or change your app's URL](/deploy/streamlit-community-cloud/manage-your-app/app-settings#view-or-change-your-apps-url), manage [public or private access to your app](/deploy/streamlit-community-cloud/share-your-app), and update your saved [secrets for your apps](/deploy/streamlit-community-cloud/deploy-your-app/secrets-management). - -If you access "**Settings**" from your [app chrome](/develop/concepts/architecture/app-chrome) in the upper-right corner of your running app, you can access features to control the appearance of your app while it's running. - -## Access your app settings - -You can get to your app's settings: - -- [From your workspace](#access-app-settings-from-your-workspace). -- [From your Cloud logs](#access-app-settings-from-your-cloud-logs). - -### Access app settings from your workspace - -From your workspace at share.streamlit.io, click the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# Delete your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/delete-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](/deploy/streamlit-community-cloud/manage-your-app/upgrade-python) for your app. -- You want to [rename your repository](/deploy/streamlit-community-cloud/manage-your-app/rename-your-app) or move your entrypoint file. - -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](/deploy/streamlit-community-cloud/get-started/trust-and-security#data-deletion). - -You can delete your app: - -- [From your workspace](#delete-your-app-from-your-workspace). -- [From your Cloud logs](#delete-your-app-from-your-cloud-logs). - -### Delete your app from your workspace - -1. From your workspace at share.streamlit.io, click the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# Edit your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/edit-your-app - - -You can edit your app from any development environment of your choice. Streamlit Community Cloud will monitor your repository and automatically copy any file changes you commit. You will immediately see commits reflected in your deployed app for most changes (such as edits to your app's Python files). - -Community Cloud also makes it easy to skip the work of setting up a development environment. With a few simple clicks, you can configure a development environment using GitHub Codespaces. - -## Edit your app with GitHub Codespaces - -Spin up a cloud-based development environment for your deployed app in minutes. You can run your app within your codespace to enjoy experimenting in a safe, sandboxed environment. When you are done editing your code, you can commit your changes to your repo or just leave them in your codespace to return to later. - -### Create a codespace for your deployed app - -1. From your workspace at share.streamlit.io, click the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# Favorite your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/favorite-your-app - - -Streamlit Community Cloud supports a "favorite" feature that lets you quickly access your apps from your workspace. Favorited apps appear at the top of their workspace with a yellow star ({{ verticalAlign: "-.25em", color: "#faca2b" }} className={{ class: "material-icons-sharp" }}>star - ---- - -# Reboot your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app - - -If you need to clear your app's memory or force a fresh build after modifying a file that Streamlit Community Cloud doesn't monitor, you may need to reboot your app. This will interrupt any user who may currently be using your app and may take a few minutes for your app to redeploy. Anyone visiting your app will see "Your app is in the oven" during a reboot. - -Rebooting your app on Community Cloud is easy! You can reboot your app: - -- [From your workspace](#reboot-your-app-from-your-workspace). -- [From your Cloud logs](#reboot-your-app-from-your-cloud-logs). - -### Reboot your app from your workspace - -1. From your workspace at share.streamlit.io, click the overflow icon ({{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>more_vert - ---- - -# Rename or change your app's GitHub coordinates - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/rename-your-app - - -Streamlit Community Cloud identifies apps by their GitHub coordinates (owner, repository, branch, entrypoint file path). If you move or rename one of these coordinates without preparation, you will lose access to administer any associated app. - -## Delete, rename, redeploy - -If you need to rename your repository, move your entrypoint file, or otherwise change a deployed app's GitHub coordinates, do the following: - -1. Delete your app. -1. Make your desired changes in GitHub. -1. Redeploy your app. - -## Regain access when you've already made changes to your app's GitHub coordinates - -If you have changed a repository so that Community Cloud can no longer find your app on GitHub, your app will be missing or shown as view-only. View-only means that you can't edit, reboot, delete, or view settings for your app. You can only access analytics. - -You may be able to regain control as follows: - -1. Revert the change you made to your app so that Community Cloud can see the owner, repository, branch, and entrypoint file it expects. -1. Sign out of Community Cloud and GitHub. -1. Sign back in to Community Cloud and GitHub. -1. If you have regained access, delete your app. Proceed with your original change, and redeploy your app. - - If this does not restore access to your app, please [contact Snowflake support](/knowledge-base/deploy/how-to-submit-a-support-case-for-streamlit-community-cloud) for assistance. They can delete your disconnected apps so you can redeploy them. For the quickest help, please provide a complete list of your affected apps by URL. - ---- - -# Upgrade your app's Python version on Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/upgrade-python - - -Dependencies within Python can be upgraded in place by simply changing your environment configuration file (typically `requirements.txt`). However, Python itself can't be changed after deployment. - -When you deploy an app, you can select the version of Python through the "**Advanced settings**" dialog. After you have deployed an app, you must delete it and redeploy it to change the version of Python it uses. - -1. Take note of your app's settings: - - - Current, custom subdomain. - - GitHub coordinates (repository, branch, and entrypoint file path). - - Secrets. - - When you delete an app, its custom subdomain is immediately available for reuse. - -1. [Delete your app](/deploy/streamlit-community-cloud/manage-your-app/delete-your-app). -1. [Deploy your app](/deploy/streamlit-community-cloud/deploy-your-app). - 1. On the deployment page, select your app's GitHub coordinates. - 1. Set your custom domain to match your deleted instance. - 1. Click "**Advanced settings**." - 1. Choose your desired version of Python. - 1. Optional: If your app had secrets, re-enter them. - 1. Click "**Save**." - 1. Click "**Deploy**." - -In a few minutes, Community Cloud will redirect you to your redployed app. - ---- - -# Upgrade your app's Streamlit version on Streamlit Community Cloud - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app/upgrade-streamlit - - -Want to use a cool new Streamlit feature but your app on Streamlit Community Cloud is running an old version of the Streamlit library? If that's you, don't worry! Here's how to upgrade your app's Streamlit version, based on how you manage your [app dependencies](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies): - -## No dependency file - -When there is no dependencies file in your repository, your app will use the lastest Streamlit version that existed when it was last rebooted. In this case, simply [reboot your app](/deploy/streamlit-community-cloud/manage-your-app/reboot-your-app) and Community Cloud will install the latest version. - -You may want to avoid getting into this situation if your app depends on a specific version of Streamlit. That is why we encourage you to use a dependency file and pin your desired version of Streamlit. - -## With a dependency file - -When your app includes a dependency file, reboot your app or change your dependency file as follows: - -- If Streamlit is not included in your dependency file, reboot the app as described above. - - Note that we don't recommend having an incomplete dependency file since `pip` won't be able to include `streamlit` when resolving compatible versions of your dependencies. - -- If Streamlit is included in your dependency file, but the version is not pinned or capped, reboot the app as described above. - - When Community Cloud reboots your app, it will re-resolve your dependency file. Your app will then have the latest version of all dependencies that are consistent with your dependency file. - -- If Streamlit is included in your dependency file, and the version is pinned (e.g., `streamlit==1.37.0`), update your dependency file. - - When you commit a change to your dependency file in your repository, Community Cloud will detect the change and automatically resolve the new dependencies. This is how you add, remove, or change all Python dependencies in general. You don't need to manually reboot your app, but you can if you want to. - ---- - -# Share your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app - - -Now that your app is deployed you can easily share it and collaborate on it. But first, let's take a moment and do a little joy dance for getting that app deployed! 🕺💃 - -Your app is now live at a fixed URL, so go wild and share it with whomever you want. Your app will inherit permissions from your GitHub repo, meaning that if your repo is private your app will be private and if your repo is public your app will be public. If you want to change that you can simply do so from the app settings menu. - -You are only allowed one private app at a time. If you've deployed from a private repository, you will have to make that app public or delete it before you can deploy another app from a private repository. Only developers can change your app between public and private. - -- [Make your app public or private](#make-your-app-public-or-private) -- [Share your public app](#share-your-public-app) -- [Share your private app](#share-your-private-app) - -## Make your app public or private - -If you deployed your app from a public repository, your app will be public by default. If you deployed your app from a private repository, you will need to make the app public if you want to freely share it with the community at large. - -### Set privacy from your app settings - -1. Access your [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings) and go to the "**Sharing**" section. - - ![Share settings on Streamlit Community Cloud](/images/streamlit-community-cloud/workspace-app-settings-sharing.png) - -2. Set your app's privacy under "Who can view this app." Select "**This app is public and searchable**" to make your app public. Select "**Only specific people can view this app**" to make your app private. - - ![Set your app's privacy in share settings](/images/streamlit-community-cloud/workspace-app-settings-sharing-change.png) - -### Set privacy from the share button - -1. From your app at `.streamlit.app`, click "**Share**" in the upper-right corner. - - ![Access the share button from your app](/images/streamlit-community-cloud/share-open.png) - -2. Toggle your app between public and private by clicking "**Make this app public**." - - ![Toggle your app between public and private from the share button](/images/streamlit-community-cloud/share-menu-public-toggle.png) - -## Share your public app - -Once your app is public, just give anyone your app's URL and they view it! Streamlit Community Cloud has several convenient shortcuts for sharing your app. - -### Share your app on social media - -1. From your app at `.streamlit.app`, click "**Share**" in the upper-right corner. -2. Click "**Social**" to access convenient social media share buttons. - - ![Social media sharing links from the share button](/images/streamlit-community-cloud/share-menu-social.png) - - - -Use the social media sharing buttons to post your app on our forum! We'd love to see what you make and perhaps feature your app as our app of the month. 💖 - - - -### Invite viewers by email - -Whether your app is public or private, you can send an email invite to your app directly from Streamlit Community Cloud. This grants the viewer access to analytics for all your public apps and the ability to invite other viewers to your workspace. Developers and invited viewers are identified by their email in analytics instead of appearing anonymously (if they view any of your apps while signed in). Read more about viewers in [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics). - -1. From your app at `.streamlit.app`, click "**Share**" in the upper-right corner. -2. Enter an email address and click "**Invite**." - - ![Invite viewers from the share button](/images/streamlit-community-cloud/share-invite-public.png) - -3. Invited users will get a direct link to your app in their inbox. - - ![Invitation email sent to viewers](/images/streamlit-community-cloud/share-invite-email.png) - -### Copy your app's URL - -From your app click "**Share**" in the upper-right corner then click "**Copy link**." - -![Copy your app's URL from the share button](/images/streamlit-community-cloud/share-copy.png) - -### Add a badge to your GitHub repository - -To help others find and play with your Streamlit app, you can add Streamlit's GitHub badge to your repo. Below is an enlarged example of what the badge looks like. Clicking on the badge takes you toin this caseStreamlit's Roadmap. - -
{{ marginBottom: '2em' }}> -
{{ width: 'fit-content', margin: 'auto' }}> - -Open in Streamlit badge for GitHub - -
-
- -Once you deploy your app, you can embed this badge right into your GitHub README.md by adding the following Markdown: - -```markdown -[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://.streamlit.app) -``` - - - -Be sure to replace `https://.streamlit.app` with the URL of your deployed app! - - - -## Share your private app - -By default an app deployed from a private repository will be private to the developers in the workspace. A private app will not be visible to anyone else unless you grant them explicit permission. You can grant permission by adding them as a developer on GitHub or by adding them as a viewer on Streamlit Community Cloud. - -Once you have added someone's email address to your app's viewer list, that person will be able to sign in and view your private app. If their email is associated with a Google account, they will be able to sign in with Google OAuth. Otherwise, they will be able to sign in with single-use, emailed links. Streamlit sends an email invitation with a link to your app every time you invite someone. - - - -When you add a viewer to any app in your workspace, they are granted access to analytics for that app as well as analytics for all your public apps. They can also pass these permissions to others by inviting more viewers. All viewers and developers in your workspace are identified by their email in analytics. Furthermore, their emails show in analytics for every app in your workspace and not just apps they are explicitly invited to. Read more about viewers in [App analytics](/deploy/streamlit-community-cloud/manage-your-app/app-analytics) - - - -### Invite viewers from the share button - -1. From your app at `.streamlit.app`, click "**Share**" in the upper-right corner. - - ![Access the share button from your app](/images/streamlit-community-cloud/share-open.png) - -2. Enter the email to send an invitation to and click "**Invite**." - - ![Invite viewers from the share button](/images/streamlit-community-cloud/share-invite.png) - -3. Invited users appear in the list below. - - ![View invited users from the share button](/images/streamlit-community-cloud/share-invited.png) - -4. Invited users will get a direct link to your app in their inbox. - - ![Invitation email sent to viewers](/images/streamlit-community-cloud/share-invite-email.png) - -- To remove a viewer, simply access the share menu as above and click the {{ verticalAlign: "-.25em" }} className={{ class: "material-icons-sharp" }}>close next to their name. - - ![Remove viewers from the share button](/images/streamlit-community-cloud/share-remove.png) - -### Invite viewers from your app settings - -1. Access your [App settings](/deploy/streamlit-community-cloud/manage-your-app/app-settings) and go to the "**Sharing**" section. - - ![Access sharing settings from your app settings](/images/streamlit-community-cloud/workspace-app-settings-sharing.png) - -2. Add or remove users from the list of viewers. Click "**Save**." - - ![Invite and remove viewers from your app settings](/images/streamlit-community-cloud/workspace-app-settings-sharing-invite.png)
- ---- - -# Embed your app - -Source: https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app/embed-your-app - - -Embedding Streamlit Community Cloud apps enriches your content by integrating interactive, data-driven applications directly within your pages. Whether you're writing a blog post, a technical document, or sharing resources on platforms like Medium, Notion, or even StackOverflow, embedding Streamlit apps adds a dynamic component to your content. This allows your audience to interact with your ideas, rather than merely reading about them or looking at screenshots. - -Streamlit Community Cloud supports both [iframe](#embedding-with-iframes) and [oEmbed](#embedding-with-oembed) methods for embedding **public** apps. This flexibility enables you to share your apps across a wide array of platforms, broadening your app's visibility and impact. In this guide, we'll cover how to use both methods effectively to share your Streamlit apps with the world. - -## Embedding with iframes - -Streamlit Community Cloud supports embedding **public** apps using the subdomain scheme. To embed a public app, add the query parameter `/?embed=true` to the end of the `*.streamlit.app` URL. - -For example, say you want to embed the 30DaysOfStreamlit app. The URL to include in your iframe is: `https://30days.streamlit.app/?embed=true`: - -```javascript -